remark-gfm: collapse is not supported
<details>
not supported
Using of <details>
tags in GFM is supposed to create collapse sections. By default this is not happening in react-markdown when gfm is added as a plugin, and I see no option to enable it.
Your environment
- OS: MacOS
- Packages: React-markdown
Steps to reproduce
- Add this section to markdown
<details>
<summary> Title</summary>
Main Section
</details>
- Add remark-gfm as react-markdown plugin
Expected behavior
A collapsible should replace the <details>
section
Actual behavior
<details
content is rendered as escaped string.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (11 by maintainers)
He’s showing the it behaves the same as GFM.
You’re missing a key point here. CommonMark, GFM, and most markdown flavors embed HTML. HTML fragments are different document(s), included inside the Markdown documents.
Markdown parsers will split the content into embeddings, here as a raw
html
node. But how to handle the HTML itself is outside of what Markdown does.For an analogy, think for HTML and SVG, SVG documents can be put in HTML pages, but they aren’t HTML. When HTML sees something SVG like, it hands off to the SVG engine to do the rest.
Here the same concept applies, Markdown sees something HTML like, and it can (optionally) hand it off to an HTML engine to do additional processing.