question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Attributes support is broken/incompatible with fenced code blocks

See original GitHub issue

Attributes 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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
vschcommented, Jul 11, 2019

@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.

0reactions
skalpa-rldcommented, Jul 12, 2019

@vsch I can confirm that the fixes in the latest EAP work as expected, so I’m closing this issue.

Thanks a lot.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found