How can I fold content in Github markdown?

xiao luo picture xiao luo · Sep 7, 2018 · Viewed 9.2k times · Source

How does github fold text blocks?

look at this issuecomment

Answer

VonC picture VonC · Sep 7, 2018

Check if this follows dear-github issue 166, which mentions:

collapsible sections are supported:

<details>
<summary>Click to expand</summary>

whatever

</details>

See more in this example.

The key is to wrap the whole contents inside the <p>:

<details><summary>stuff with *mark* **down**</summary><p>

## _formatted_ **heading** with [a](link)

---
{{standard 3-backtick code block omitted from here due to escaping issues}}
---

Collapsible until here.
</p></details>