Dropdown accordion doesn't accept rich/markdown content
Origin of the problem
The following does not work
<details>
More content! :smile:
![image](/uploads/2e8c86955b6b4a2324b128f71f4d4027/image.png)
</details>
example:
while the following does work:
<details>
More content! :smile:
<img src="/uploads/2e8c86955b6b4a2324b128f71f4d4027/image.png"/>
</details>
example:
it’s because of the change to html, or rather the wrapping of the html, that makes the markdown no longer be recognised.
Problem
This makes it so that whenever you want to wrap existing content written in markdown inside <details>
tags, it is no longer seen as markdown, thus not rendering it properly.
This causes information being lost and a less than optimal UX
Proposal
on gitlab.com you can use the html parser, to be able to mix markdown and HTML markup
add the parser tag to the beginning of the post, immediately after the frontmatter:
{::options parse_block_html="true" /} ... text to parse {::options parse_block_html="false" /}
In gitlab comments you shouldn't even have to add this to content wrapped in <details></details>
. It should just be rendered correctly automatically.
Usecase
The usecases for which this should function as is proposed:
- putting original but no longer super valid information (for example the original issue text) within such an expandable section to make the post shorter and clearer, while keeping all information.
- if you have a long merge request with lots of images, this way you can hide the images until they are actually needed.
Value
- Better consistent rendering of content
- consistent UX when implementing said feature
- no content information lost due to no formatting
- consistent reading experience
Related issues
x
CC/Call to actions
@balasankarc (you were part of the conversation in the chat) @DouweM (as you worked on the copy source markdown/comment code for use within your own comments)