1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-27 14:48:19 +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

View File

@ -27,6 +27,8 @@ Here is a macro <<version>>.
This is a macro with content <<link to:"HelloThere"><This is a //link// to something.>>
This is another macro with content, this time including another macro: <<link to:"HelloThere"><This is a //link// to something in <<version>> of TiddlyWiki.>>. That's that.
! This is a new heading
This is a paragraph
immediately after