You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the mode for fenced code blocks is determined using the markdown-code-lang-modes alist. It maps the first occuring word in the infostring to a language mode.
The first word of the info string is typically used to specify the language of the code sample, and rendered in the class attribute of the code tag. However, this spec does not mandate any particular treatment of the info string.
Therefore, it would be nice if the mode could be determined using a user-defined function that takes the infostring as input.
I specifically ran into this corner case when using this MDX plugin that was using the infostring to add a title attribute to code blocks using the format lang:title.
For example:
def foo():
pass
I would want to use python-mode in this case, even though the first word is py:Python.
The text was updated successfully, but these errors were encountered:
Currently, the mode for fenced code blocks is determined using the
markdown-code-lang-modes
alist. It maps the first occuring word in the infostring to a language mode.This is generally fine, however, the CommonMark Spec doesn't say that this is how the infostring MUST be used:
Therefore, it would be nice if the mode could be determined using a user-defined function that takes the infostring as input.
I specifically ran into this corner case when using this MDX plugin that was using the infostring to add a title attribute to code blocks using the format
lang:title
.For example:
I would want to use
python-mode
in this case, even though the first word ispy:Python
.The text was updated successfully, but these errors were encountered: