question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`highlightAuto` with language subset doesn't appear to be working

See original GitHub issue

Hello,

Re:

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:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
egor-rogovcommented, Oct 14, 2018

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.

1reaction
egor-rogovcommented, Oct 16, 2018

<del>Okay, basically we have two options here:

<del>1. Update the docs to reflect the current behavior (i. e. that highlightAuto() and configure() 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.

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found