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
[markdown-language-features / markdownEngine.ts / getMarkdownOptions] Expose (export) the highlight.js object used for preview highlighting to allow adding new languages easily (registerLanguage)
#224173
Closed
FALLAI-Denis opened this issue
Jul 29, 2024
· 3 comments
The internal markdown-language-features extension provides highlighting of fenced blocks associated with a language when previewing a Markdown file.
To do this, it imports the highlight.js component and uses its highlight function, but this import is local to the getMarkdownOptions function of the markdownEngine.ts file.
This does not allow the highlight.js component to be enriched with new languages (or even removed).
By declaring the import of the highlight.js component at the global level, and exposing it (export) outside the markdown-language-features extension, possibly through a function or an interface, this would allow it to be enriched or its behavior adapted from another extension.
It is still necessary to have a highlight.js plugin supporting the language to implement, and possibly a textmate grammar for highlighting when editing the Markdown file itself, but the work would be simplified if the highlight.js object used for the Markdown preview was public and modifiable.
FYI, solution found for implementing additional language highlighting both when editing a Markdown file and previewing it:
Hi,
The internal markdown-language-features extension provides highlighting of fenced blocks associated with a language when previewing a Markdown file.
To do this, it imports the
highlight.js
component and uses itshighlight
function, but this import is local to the getMarkdownOptions function of the markdownEngine.ts file.This does not allow the
highlight.js
component to be enriched with new languages (or even removed).By declaring the import of the
highlight.js
component at the global level, and exposing it (export) outside the markdown-language-features extension, possibly through a function or an interface, this would allow it to be enriched or its behavior adapted from another extension.It is still necessary to have a
highlight.js
plugin supporting the language to implement, and possibly a textmate grammar for highlighting when editing the Markdown file itself, but the work would be simplified if thehighlight.js
object used for the Markdown preview was public and modifiable.FYI, solution found for implementing additional language highlighting both when editing a Markdown file and previewing it:
Thanks.
The text was updated successfully, but these errors were encountered: