Closed jurgenhaas closed 4 months ago
We really need to be shown something is actually wrong with our library (as we ship it) to assist. Right now it just looks like Drupal's optimizer is broken (however reliable it typically is) - and it's unclear why.
The only\
present in that line all appear to be valid regex escapes.
It's probably more the mck89/peast/lib/Peast/Syntax/Scanner.php
which is used by Drupal. I'd guess, that the research would be between the two components to see what's wrong.
For our current theme, we've "fixed" this by not optimizing highlight.js - so that works. Whether the issue between highlight.js and mck89/peast should be addressed or not remains to be decided.
Unless you can show that our JS is somehow actually invalid it's definitely not an issue with Highlight.js. The fact that its parsed by all modern browsers without difficultly would seem to suggest its valid. I'd suggest filing a support issue against the scanner project if you want to get to the bottom of this.
We are using the
highlight.min.js
version v11.9.0 as part of a Drupal theme. Drupal core has a fairly good asset optimizer and send all css and js files through a process that also parses the input.With this highlight file, that process fails with the message
Syntax error: Unexpected \, File: themes/custom/bst/js/highlight.min.js, Line: 378, Column: 39, Index: 34322
. The stack trace looks like this:The offending line appears to be this one: