1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-22 02:04:51 +00:00

Fixed parsing problem

We need to recheck for the next terminator after a successful run match
to cope with the situation that the run match included the previously
found terminator match
This commit is contained in:
Jeremy Ruston
2012-06-05 22:01:06 +01:00
parent ee7fba9297
commit ad25ab4c1a
2 changed files with 5 additions and 1 deletions

View File

@@ -168,9 +168,11 @@ WikiTextRenderer.prototype.parseRunTerminated = function(terminatorRegExp,option
if(rule) {
tree.push.apply(tree,rule.parse.call(this,runRuleMatch,false));
}
// Look for the next run rule
// Look for the next run rule and the next terminator match
this.parser.runRegExp.lastIndex = this.pos;
runRuleMatch = this.parser.runRegExp.exec(this.source);
terminatorRegExp.lastIndex = this.pos;
terminatorMatch = terminatorRegExp.exec(this.source);
}
}
// Process the remaining text