Skip to content

Syntax highlighting in a code block with more than one annotation #443

Answered by yhatt
barafael asked this question in Q&A
Discussion options

You must be logged in to vote

CommonMark, the normative spec of Markdown, treats the first word that is following to the fence ``` as the language for syntax highlighting. , is not treated as a delimiter of the language so the code block uses the unknown rust, language to highlight, not rust language.

If possible, you should remove the comma following to rust language string, like this:

```rust no_run, my-context

```

See also: markdown-it/markdown-it#626 (comment). This thread makes clear that , is not allowed in CommonMark.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@barafael
Comment options

Answer selected by barafael
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants