Fixed type block bug

This commit is contained in:
Jeremy Ruston
2012-03-03 13:35:51 +00:00
parent 81129629de
commit 128c94804a
2 changed files with 26 additions and 5 deletions

View File

@@ -400,9 +400,10 @@ var rules = [
{
name: "typedBlock",
match: "^\\$\\$\\$(?:.*)\\n",
lookaheadRegExp: /^\$\$\$(.*)\n((?:.|\n)*?)\$\$\$/mg,
lookaheadRegExp: /^\$\$\$(.*)\n((?:^[^\n]*\n)+?)(^\f*\$\$\$$\n?)/mg,
handler: function(w)
{
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
// The wikitext parsing infrastructure is horribly unre-entrant