Attributes support is broken/incompatible with fenced code blocks
See original GitHub issueAttributes added to fenced code blocks are not applied to HTML.
Additionally they just break PlantUML support in the preview (which is actually my use-case. I need to be able to add attributes to plantuml
code-blocks as I convert my Markdown using pandoc.
Examples
The attribute is ignored: ```lang {style=“border: 2px solid #000”} echo 42; ```
This breaks PlantUML preview: ```plantuml {caption=“Some text”} Some puml code ```
Ideally, attributes should be supported on code blocks. If that’s not possible if would be great if, at least, there were just ignored by the PlantUML support code so they don’t break the preview anymore.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
markdownlint/Rules.md at main - GitHub
To fix this, remove the trailing space from the end of the line. Note: Trailing space is allowed in indented and fenced code...
Read more >Code blocks - Material for MkDocs - GitHub Pages
Code blocks and examples are an essential part of technical project documentation. Material for MkDocs provides different ways to set up syntax highlighting ......
Read more >Escape Markdown Fenced Code Blocks
It turns out Markdown has a way to escape code fencing using special character ... To escape a fenced code block you can...
Read more >Fenced code blocks - CommonMark Spec
In this case, the HTML block is terminated by the newline — the **hello** text remains verbatim — and regular parsing resumes, ...
Read more >Code block in spoiler with markdown - gitlab - Stack Overflow
For example, the original implementation doesn't support fenced code blocks (it uses indentation for code blocks) or spoiler tags at all.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@skalpa-rld, the issue for plantUML rendering of fenced code blocks is a bug in the plugin recognition of plant uml and other special code fenced blocks. The rendering uses the first word of the info string to generate the HTML class attribute but the code uses the whole string. I will fix this.
The attribute coming after the fenced code is an issue for CommonMark which does not have a limitation on the info string. So anything can be used for the info string. I will see if I can add handling of attributes after the info string (as being the tail end of the info string) so that attributes can be added after it.
I will fix it shortly and make an EAP release with the fix.
@vsch I can confirm that the fixes in the latest EAP work as expected, so I’m closing this issue.
Thanks a lot.