mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-08 23:03:50 +00:00
Updated wikitext class
rule to use parseBlockTerminated() method
This commit is contained in:
parent
52f86e7b01
commit
698f2c39cb
@ -39,31 +39,9 @@ exports.parse = function(match,isBlock) {
|
|||||||
match = reStart.exec(this.source);
|
match = reStart.exec(this.source);
|
||||||
if(match) {
|
if(match) {
|
||||||
this.pos = match.index + match[0].length;
|
this.pos = match.index + match[0].length;
|
||||||
// Skip any whitespace
|
tree = this.parseBlockTerminated(reEnd,match[1]);
|
||||||
this.skipWhitespace();
|
|
||||||
// Check if we've got the end marker
|
|
||||||
reEnd.lastIndex = this.pos;
|
|
||||||
endMatch = reEnd.exec(this.source);
|
|
||||||
// Parse the text into blocks
|
|
||||||
while(this.pos < this.sourceLength && !(endMatch && endMatch.index === this.pos)) {
|
|
||||||
var blocks = this.parseBlock();
|
|
||||||
for(var t=0; t<blocks.length; t++) {
|
|
||||||
blocks[t].addClass(match[1]);
|
|
||||||
tree.push(blocks[t]);
|
|
||||||
}
|
|
||||||
// Skip any whitespace
|
|
||||||
this.skipWhitespace();
|
|
||||||
// Check if we've got the end marker
|
|
||||||
reEnd.lastIndex = this.pos;
|
|
||||||
endMatch = reEnd.exec(this.source);
|
|
||||||
}
|
|
||||||
reEnd.lastIndex = this.pos;
|
|
||||||
endMatch = reEnd.exec(this.source);
|
|
||||||
if(endMatch) {
|
|
||||||
this.pos = endMatch.index + endMatch[0].length;
|
|
||||||
}
|
}
|
||||||
return tree;
|
return tree;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user