Skip to content

Commit

Permalink
pass match since its no longer global
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed Apr 27, 2020
1 parent c6f84bb commit 3f2673d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/highlight.js
Expand Up @@ -199,7 +199,7 @@ const HLJS = function(hljs) {
return top;
}

function endOfMode(mode, matchPlusRemainder) {
function endOfMode(mode, match, matchPlusRemainder) {
let matched = regex.startsWith(mode.endRe, matchPlusRemainder);

if (matched) {
Expand All @@ -220,7 +220,7 @@ const HLJS = function(hljs) {
// even if before:end fires an `ignore` it's still possible
// that we might trigger the end node because of a parent mode
if (mode.endsWithParent) {
return endOfMode(mode.parent, matchPlusRemainder);
return endOfMode(mode.parent, match, matchPlusRemainder);
}
}

Expand Down Expand Up @@ -279,7 +279,7 @@ const HLJS = function(hljs) {
var lexeme = match[0];
var matchPlusRemainder = codeToHighlight.substr(match.index);

var end_mode = endOfMode(top, matchPlusRemainder);
var end_mode = endOfMode(top, match, matchPlusRemainder);
if (!end_mode) { return NO_MATCH; }

var origin = top;
Expand Down

0 comments on commit 3f2673d

Please sign in to comment.