From ca95f1069fae5223022ad3756366aeab79c9d48f Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Wed, 13 Jan 2021 11:48:42 +0000 Subject: [PATCH] Fixed comment parsers to match end marker correctly Fixes #5396 --- core/modules/parsers/wikiparser/rules/commentblock.js | 2 +- core/modules/parsers/wikiparser/rules/commentinline.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/parsers/wikiparser/rules/commentblock.js b/core/modules/parsers/wikiparser/rules/commentblock.js index 84ee897ba..b7651c272 100644 --- a/core/modules/parsers/wikiparser/rules/commentblock.js +++ b/core/modules/parsers/wikiparser/rules/commentblock.js @@ -31,7 +31,7 @@ exports.findNextMatch = function(startPos) { this.matchRegExp.lastIndex = startPos; this.match = this.matchRegExp.exec(this.parser.source); if(this.match) { - this.endMatchRegExp.lastIndex = startPos + this.match[0].length; + this.endMatchRegExp.lastIndex = this.match.index + this.match[0].length; this.endMatch = this.endMatchRegExp.exec(this.parser.source); if(this.endMatch) { return this.match.index; diff --git a/core/modules/parsers/wikiparser/rules/commentinline.js b/core/modules/parsers/wikiparser/rules/commentinline.js index 6e697e6c0..671bd79d6 100644 --- a/core/modules/parsers/wikiparser/rules/commentinline.js +++ b/core/modules/parsers/wikiparser/rules/commentinline.js @@ -31,7 +31,7 @@ exports.findNextMatch = function(startPos) { this.matchRegExp.lastIndex = startPos; this.match = this.matchRegExp.exec(this.parser.source); if(this.match) { - this.endMatchRegExp.lastIndex = startPos + this.match[0].length; + this.endMatchRegExp.lastIndex = this.match.index + this.match[0].length; this.endMatch = this.endMatchRegExp.exec(this.parser.source); if(this.endMatch) { return this.match.index;