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

Figure out how to use newer highlightjs #1622

Open
ehuss opened this issue Aug 2, 2021 · 4 comments
Open

Figure out how to use newer highlightjs #1622

ehuss opened this issue Aug 2, 2021 · 4 comments
Labels
A-Highlighting Area: Code colored syntax highlighting

Comments

@ehuss
Copy link
Contributor

ehuss commented Aug 2, 2021

highlightjs 11 removed a feature called "HTML merging". This is a feature we are depending on to handle "boring" lines, which get wrapped with <span class="boring">. HLJS 11 now completely strips HTML out of a code block.

There is discussion at highlightjs/highlight.js#2889 about writing a plugin to add this functionality back in, but I do not understand the plugin API well enough to write that (the current example there does not work).

Either we'll need to figure out how to get that working, or we'll need to find a new highlighting engine. #1494 is a potential route, though I am concerned about the significant performance loss.

@notriddle
Copy link
Contributor

#1652 seems to perform a lot better than the earlier syntect benchmarks.

@sanmai-NL
Copy link

I have good experiences with Prism.js.
Lightweight and very functional.

@ISSOtm
Copy link
Contributor

ISSOtm commented Jun 26, 2022

I wanted to start working on this, but I don't want the effort to be wasted in case #1652 is merged instead. Should I go ahead regardless?

@joshgoebel
Copy link

What is a boring line? How does one know which lines are boring Before the highlighting has happened?

ehuss added a commit to ehuss/mdBook that referenced this issue May 13, 2023
This updates highlight.js to 10.7.3, which picks up various syntax highlighting fixes.
This is keeping on the 10.x release due to rust-lang#1622.

I have also added a few requested languages: abnf

Note that there is a new deprecation in this release. I haven't updated the javascript code to avoid breaking any projects which just override highlight.js in their theme. Unfortunately this will result in a deprecation warning in the console, which can't easily be turned off.

Closes rust-lang#1344
Closes rust-lang#1674
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Highlighting Area: Code colored syntax highlighting
Projects
None yet
Development

No branches or pull requests

5 participants