-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
Add specification for info strings with inline code #750
base: master
Are you sure you want to change the base?
Conversation
Add RST-style colon-delimited info strings to inline code :python:`foo("abc", a=123)`
This conflicts with emoji shortcodes such as used on here on GH, and likely conflicts with the generic directive proposal, which is in several popular projects such as markdown-it and the things I work on (micromark, remark, mdx, markdown-rs) |
Good point, that is unfortunate. Do you have a better suggestion, or should this just be dropped? Maybe something like |
Hmm. Tough!
Fenced code supports multiple words, and it puts the thing after the opening backticks. So perhaps we could do something with So like, if you start the code with a special starting sequence ( Definitely not sure tho! |
This certainly isn't appropriate for the core specification. I think several implementations support postfixed attributes inside curly braces: `foo("abc", a=123)`{python} |
Pandoc has always supported a consistent attribute syntax for both code blocks and inline code.
Note: the This is what I would have preferred for commonmark, too, and I argued for it, but some of the others involved preferred to be less opinionated about the "info string." |
Could you elaborate on this? It came up in discussion at #745 where discussion was about adding some way to specify math inline |
I wonder if a combination of @jgm's mention and current link syntax would work to be less programmy.
I think I saw this discussed somewhere at some point, I'll try to dig up the thread I don't have any idea what a strong enough separator would be, almost every sigil is used in some language or other.
Tricky question! |
I actually like We can make it even safer by only accepting one single word (relaxed with |
This wouldn't be backwards compatible but something in the wild is Typst, which allows you to use info strings in multi-backtick inlines only.
|
This adds RST-style colon-delimited info strings to inline code, which can be used for code highlighting
This takes inspiration from RST roles.