`highlightAuto` with language subset doesn't appear to be working
See original GitHub issueHello,
Re:
- /highlightjs/highlight.js/blob/
0651014
/docs/api.rst#highlightautovalue-languagesubset (we use this… and thank you and your team for the longevity and expertise with this package 😃 - https://openuserjs.org/…#comment-16615f8e2df (one target where it’s currently not auto highlighting since it’s not a named fence)
- /OpenUserJS/OpenUserJS.org/pull/1528/files#diff-
b9cfc7f
(Dep upgrade from highlight.js@9.12.0 to highlight.js@9.13.0) - /OpenUserJS/OpenUserJS.org/blob/
c5cb49c
/libs/markdown.js#L225-L260 (our code where it currently works in highlight.js@9.12.0 but not highlight.js@9.13.0 which is currently on production. Using a limited Array of Strings.)
Spec:
$ node -v
v10.12.0
NOTES:
- https://openuserjs.org/…#comment-16627b793f6 (fixed this one to be a named fence to ensure correct library is being loaded and it is along with the CSS we inject… so it is currently working with named ones just not automatic detection).
- All languages are available for named fences however we have had to limit unnamed fences since auto-detection doesn’t always pin the right language. Been through a few revisions and landed on this methodology as the best available for our use cases.
- Same issue in development. Clean package installs, etc.
- We use ES5 syntax as a default and minimal to none ES6+.
Thanks for the look.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to use highlight.js
The bare minimum to auto-detect the language and highlight some code. // load the library and ALL languages hljs = require('highlight.js'); html =...
Read more >Highlight.js in Angular 2+ on dynamic content - A Dev Solved It
A work-around for Angular is to call the highlightBlock(block) method on each code block, like described in this Stack Overflow post.
Read more >The Symbols Subset option is missing in both Excel and Word
The Symbols Subset option is missing in both Excel and Word (2010)- I can't insert any greek letters. What to do?!
Read more >brief-highlightjs | Yarn - Package Manager
Syntax highlighting with language autodetection. ... with pretty much any markup, doesn't depend on any framework and has automatic language detection.
Read more >ReDOS vulnerabities: multiple grammars - software database | Vulners
On the server-side infinite freezes could occur… effectively preventing users ... If you are using highlightAuto to detect the language (and have any...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ah, I see. It doesn’t accept aliases (and never did), so use
xquery
instead. Please leave the issue open, we’ll need to rethink this. Probably we should accept aliases as well.<del>Okay, basically we have two options here:
<del>1. Update the docs to reflect the current behavior (i. e. that
highlightAuto()
andconfigure()
don’t accept aliases). Previously aliases were accepted but ignored (that’s too bad), now an error occurs. This change appeared quite accidentally, it wasn’t planned. 2. Tweak the code to actually accept aliases along with language names.</del><del>(2) is doable but seems not worth the effort. It shouldn’t be a big problem for the caller to specify a right name. So I’m inclined to (1).</del> <del>@marcoscaceres what do you think?</del>
I’m wrong, sorry for the buzz. That’s my bug 😦 Will fix it.