Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support collapsable <details> blocks #826

Open
amomchilov opened this issue Feb 6, 2025 · 0 comments
Open

Support collapsable <details> blocks #826

amomchilov opened this issue Feb 6, 2025 · 0 comments

Comments

@amomchilov
Copy link

In technical writing, it's common to want to include collapsible sections for content that might be useful, but which you don't want to spam out the full height of your post. E.g. a large code listing.

For comparison, GitHub supports this via the standard <details> tag, whereas Discourse has its own [details="Summary"] ... [/details] syntax.

Kramdown already tolerates at least some HTML input (e.g. <p>, <a>, <b>, <u>, etc.), including <details>. However, it doesn't process any of the MarkDown markup that might be inside that body, so e.g. it's impossible to use MarkDown links or code blocks within collapsible sections.

Example:

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

[Example link](http://example.com)

``` ruby
p "Hello, world!"
```

> quote block

</details>

GitHub rendering:

Click to expand

Example link

p "Hello, world!"

quote block

amomchilov added a commit to amomchilov/amomchilov.github.io that referenced this issue Feb 8, 2025
Kramdown doesn't support MarkDown within `<details>` blocks.
gettalong/kramdown#826
amomchilov added a commit to amomchilov/amomchilov.github.io that referenced this issue Feb 8, 2025
Kramdown doesn't support MarkDown within `<details>` blocks.
gettalong/kramdown#826
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant