1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-25 23:03:15 +00:00

Replaced restructuring and added fallback comment

This commit is contained in:
Miha Lunar 2021-04-25 13:12:45 +02:00
parent 1b226c7556
commit 23bd7e7817

View File

@ -168,6 +168,7 @@ WikiParser.prototype.findNextMatch = function(rules,startPos) {
WikiParser.prototype.parseRule = function(rule) { WikiParser.prototype.parseRule = function(rule) {
var start = this.pos, var start = this.pos,
blocks = rule.parse(); blocks = rule.parse();
// Use fallback parent range for blocks that don't define their own
for(var i=0; i<blocks.length; i++) { for(var i=0; i<blocks.length; i++) {
var block = blocks[i]; var block = blocks[i];
if(block.start !== undefined) { if(block.start !== undefined) {
@ -229,7 +230,7 @@ WikiParser.prototype.parseBlock = function(terminatorRegExpString) {
var start = this.pos; var start = this.pos;
var children = this.parseInlineRun(terminatorRegExp); var children = this.parseInlineRun(terminatorRegExp);
var end = this.pos; var end = this.pos;
return [{type: "element", tag: "p", children, start, end }]; return [{type: "element", tag: "p", children: children, start: start, end: end }];
}; };
/* /*