Fixed comment parsers to match end marker correctly

Fixes #5396
browser-messaging-saver
jeremy@jermolene.com 2021-01-13 11:48:42 +00:00
rodzic 65ffe96cc2
commit ca95f1069f
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -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;

Wyświetl plik

@ -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;