Skip to content

Commit 3f2673d

Browse files
committed
pass match since its no longer global
1 parent c6f84bb commit 3f2673d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/highlight.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ const HLJS = function(hljs) {
199199
return top;
200200
}
201201

202-
function endOfMode(mode, matchPlusRemainder) {
202+
function endOfMode(mode, match, matchPlusRemainder) {
203203
let matched = regex.startsWith(mode.endRe, matchPlusRemainder);
204204

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

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

282-
var end_mode = endOfMode(top, matchPlusRemainder);
282+
var end_mode = endOfMode(top, match, matchPlusRemainder);
283283
if (!end_mode) { return NO_MATCH; }
284284

285285
var origin = top;

0 commit comments

Comments
 (0)