mdBook icon indicating copy to clipboard operation
mdBook copied to clipboard

Better syntax highlighting support - consider switchting from HighlightJS to Prism

Open joepio opened this issue 1 year ago • 6 comments

Problem

The current highlighter (powered by highlight.ts) does not support .tsx.

Proposed Solution

Switch to Prism

Notes

Some related discussions:

https://github.com/highlightjs/highlight.js/issues/3625

joepio avatar Feb 07 '24 15:02 joepio

Only if the switch is moving from client-side highlight.js to build-side Prism.

Client-side highlight.js & Prism both are incredibly wasteful for documentation. For the most part, your documentation’s code samples aren’t changing so why is mdBook shipping client-side parsing libraries at all & making all downstream users parse & highlight the exact same unchanging content when this tool should be doing the syntax highlighting at build time to save energy, data, & time for users. See also: https://github.com/rust-lang/mdBook/issues/1383

toastal avatar Jun 25 '24 08:06 toastal