Collapsible header in Markdown to html

Sasha-Li picture Sasha-Li · Jul 22, 2015 · Viewed 20.8k times · Source

Our internal git-lab wiki works with Markdown. I made several summaries of articles and want to post them in our wiki, in such a way that if I click on the header, it should unfold and the text should become visible, basically like in this example

Does Markdown have this expand/collapse/fold function?

Answer

Touby picture Touby · Aug 5, 2016

Try:

<details>
  <summary>Your header here! (Click to expand)</summary>
  Your content here...
  > markup like blockquote's should even work on github!
  more content here...
</details>

You can try this sort of thing here:

    <details>
      <summary>Your header here! (Click to expand)</summary>
      Your content here...</br>
      (markup only where supported)</br>
      more content here...</br>
    </details>

This works for me with Chrome, but may not work yet for other browsers. There are some related posts at github.