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
Some users put a dummy language (for example "unknown") while using code block in markdown if no language provided in order not to conflict with the line numbering and line highlighting properties if for example rehype-prism-plus is used.(here).. They prefer to reserve the first word for the language and go with the dummy language approach:
```unknown {1}
<Component/>
```
For those who want to go with a dummy language (like above "unknown"), needed to set another option (handleMissingLanguageAs) in the remark-flexible-code-titles in order to choose a dummy language string, and the plugin will assign this option into node.lang instead of null. So, the remark-flexible-code-titles will ensure that the dummy language will be rendered in the class attribute of the code tag, without explicitly saying "unknown" in markdown.
Possible usage of the new option could be:
importremarkCodeTitlesfrom"remark-flexible-code-titles";
...
.use(remarkCodeTitles,{handleMissingLanguageAs: "unknown",// or "dummy" what so ever})
The text was updated successfully, but these errors were encountered:
Some users put a dummy language (for example "unknown") while using code block in markdown if no language provided in order not to conflict with the line numbering and line highlighting properties if for example
rehype-prism-plus
is used.(here).. They prefer to reserve the first word for the language and go with the dummy language approach:For those who want to go with a dummy language (like above "unknown"), needed to set another option (handleMissingLanguageAs) in the
remark-flexible-code-titles
in order to choose a dummy language string, and the plugin will assign this option intonode.lang
instead ofnull
. So, theremark-flexible-code-titles
will ensure that the dummy language will be rendered in the class attribute of the code tag, without explicitly saying "unknown" in markdown.Possible usage of the new option could be:
The text was updated successfully, but these errors were encountered: