mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-08 23:03:50 +00:00
fix: parsemode don't have node
This commit is contained in:
parent
9df36a2b15
commit
2a75077747
@ -34,6 +34,7 @@ Parse the most recent match
|
|||||||
*/
|
*/
|
||||||
exports.parse = function() {
|
exports.parse = function() {
|
||||||
// Move past the pragma invocation
|
// Move past the pragma invocation
|
||||||
|
var start = this.parser.pos;
|
||||||
this.parser.pos = this.matchRegExp.lastIndex;
|
this.parser.pos = this.matchRegExp.lastIndex;
|
||||||
// Parse whitespace delimited tokens terminated by a line break
|
// Parse whitespace delimited tokens terminated by a line break
|
||||||
var reMatch = /[^\S\n]*(\S+)|(\r?\n)/mg,
|
var reMatch = /[^\S\n]*(\S+)|(\r?\n)/mg,
|
||||||
@ -61,15 +62,17 @@ exports.parse = function() {
|
|||||||
this.parser.parseAsInline = true;
|
this.parser.parseAsInline = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// No parse tree nodes to return
|
return [{
|
||||||
return [];
|
type: "parsermode",
|
||||||
|
parseAsInline: this.parser.parseAsInline,
|
||||||
|
start: start,
|
||||||
|
end: this.parser.pos
|
||||||
|
}];
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.serialize = function(tree) {
|
exports.serialize = function(tree,serialize) {
|
||||||
// Parser mode
|
var mode = tree.parseAsInline ? "inline" : "block";
|
||||||
var mode = tree.parser.parseAsInline ? "inline" : "block";
|
return "\\parsermode " + mode + "\n\n" + serialize(tree.children);
|
||||||
// Construct the serialized string
|
|
||||||
return "\\parsermode " + mode;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user