How can I fold content in Github markdown?

Viewed 20530

How does github fold text blocks?

look at this issuecomment

2 Answers

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>

You can start the folded sections expanded by default as well.

<details open>

  <summary>click to collapse</summary>

  this one starts expanded because of the "open"

</details>
Related