Possible to modify Details extension to accept Markdown header syntax? #1717
-
Hey folks, Is it possible to modify the behavior of the Details extension so the first line (collapsible section header) can be inserted using Markdown header syntax? For example, can I configure the parser to convert this:
To this:
Ideally for h2s to h5s. I'm not an expert in Python (basic understanding), so please try to ELI5 what code I can copy and paste into the details.py file. I have tried messing around with it a bit by coping code from the section of the Markdown BlockProcessor that processer headers, to no avail :( Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think what you are requesting is for something where an ID can be added to a Details element: #1194. With that said, I have not yet decided upon or added such functionality, but if you follow the link, I offer some suggestions, such as wrapping the details with a If you must specifically have a header embedded within the summary, you will have to use raw HTML to accomplish the task. While, if I recall correctly, details may allow for inline Markdown, it will not recognize block-level syntax such as headers. |
Beta Was this translation helpful? Give feedback.
I think what you are requesting is for something where an ID can be added to a Details element: #1194.
With that said, I have not yet decided upon or added such functionality, but if you follow the link, I offer some suggestions, such as wrapping the details with a
<div id="some-id" markdown>
.If you must specifically have a header embedded within the summary, you will have to use raw HTML to accomplish the task. While, if I recall correctly, details may allow for inline Markdown, it will not recognize block-level syntax such as headers.