We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dbfffac commit c7d3d99Copy full SHA for c7d3d99
src/highlight.js
@@ -707,6 +707,16 @@ https://highlightjs.org/
707
mode_buffer += codeToHighlight.slice(match.index, match.index + 1);
708
return 1;
709
}
710
+
711
+ // edge case for when illegal matches $ (end of line) which is technically
712
+ // a 0 width match but not a begin/end match so it's not caught by the
713
+ // first handler (when ignoreIllegals is true)
714
+ // https://github.com/highlightjs/highlight.js/issues/2522
715
+ if (lastMatch.type==="illegal" && lexeme === "") {
716
+ mode_buffer += codeToHighlight.slice(match.index, match.index + 1);
717
+ return 1;
718
+ }
719
720
lastMatch = match;
721
722
if (match.type==="begin") {
0 commit comments