-
-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to treat ,
as a word delimiter for info-strings
#246
Comments
Then we should definitely support it, imo. PRs happily accepted. |
Just noticed this too. I'd be happy to take on implementing this! |
Implementation-wise where exactly should this change go? Should it change the parsed AST / HTML to split the language for the info string on a comma (this would seem to diverge from |
Out of pure curiosity, how does GitHub use this comma delimiting feature? I tried to find an example on their help docs but couldn’t find an explanation. |
We did this for docs.rs' highlighting plugin (using
AFAIK it doesn't, it just strips everything after the comma at some point between markdown -> html. |
Ah, got it—the stripping is simply to remove the info, not do anything special with it. 👍 |
Currently when parsing the info-string to determine the codeblock language the word up to the first space character is used:
comrak/src/html.rs
Lines 490 to 492 in 03238b8
This causes issues with markdown such as in the
regex
readme using the info-stringrust,ignore
, it is passed into the syntax highlighter as the stringrust,ignore
and applied as an attributeclass="language-rust,ignore"
on the element. Both rustdoc and github support the,
character being a delimiter between the language and additional attributes (rustdoc
actually supports more, but that's for back-compat, afaik only[ ,]
is intended to be used).The text was updated successfully, but these errors were encountered: