1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Fixed comment parsers to match end marker correctly

Fixes #5396
This commit is contained in:
jeremy@jermolene.com 2021-01-13 11:48:42 +00:00
parent 65ffe96cc2
commit ca95f1069f
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ exports.findNextMatch = function(startPos) {
this.matchRegExp.lastIndex = startPos; this.matchRegExp.lastIndex = startPos;
this.match = this.matchRegExp.exec(this.parser.source); this.match = this.matchRegExp.exec(this.parser.source);
if(this.match) { 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); this.endMatch = this.endMatchRegExp.exec(this.parser.source);
if(this.endMatch) { if(this.endMatch) {
return this.match.index; return this.match.index;

View File

@ -31,7 +31,7 @@ exports.findNextMatch = function(startPos) {
this.matchRegExp.lastIndex = startPos; this.matchRegExp.lastIndex = startPos;
this.match = this.matchRegExp.exec(this.parser.source); this.match = this.matchRegExp.exec(this.parser.source);
if(this.match) { 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); this.endMatch = this.endMatchRegExp.exec(this.parser.source);
if(this.endMatch) { if(this.endMatch) {
return this.match.index; return this.match.index;