Skip to content

Commit

Permalink
fix(parser) prevent gobbling of illegal newlines (#4142)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel authored Dec 14, 2024
1 parent aaa57e9 commit 3e06867
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ const HLJS = function(hljs) {
// first handler (when ignoreIllegals is true)
if (match.type === "illegal" && lexeme === "") {
// advance so we aren't stuck in an infinite loop
modeBuffer += "\n";
return 1;
}

Expand Down

0 comments on commit 3e06867

Please sign in to comment.