Skip to content
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

[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
Assignees

Comments

@FALLAI-Denis
Copy link

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 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:

Thanks.

@mjbvz
Copy link
Collaborator

mjbvz commented Jul 29, 2024

#91279 is a better solution for this

@mjbvz mjbvz closed this as completed Jul 29, 2024
@FALLAI-Denis
Copy link
Author

FALLAI-Denis commented Jul 30, 2024

Open since 24, Feb 2020…
Solution I suggest seem to be more easy to implement and can be temporary, without break for other extensions.

@mjbvz
Copy link
Collaborator

mjbvz commented Jul 30, 2024

Exposing an entire 3rd party library as api is not going to be good long term (or short term)

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants