1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-07 16:00:28 +00:00

feat: allow recursive

This commit is contained in:
lin onetwo 2024-07-30 00:56:28 +08:00
parent 84e27c05b9
commit 078967c830
4 changed files with 5 additions and 5 deletions

View File

@ -57,7 +57,7 @@ exports.parse = function() {
}]; }];
}; };
exports.serialize = function(tree) { exports.serialize = function(tree,serialize) {
return "\n```" + tree.attributes.language.value + "\n" + tree.attributes.code.value + "\n```\n"; return "\n```" + tree.attributes.language.value + "\n" + tree.attributes.code.value + "\n```\n";
} }

View File

@ -55,8 +55,8 @@ exports.parse = function() {
}]; }];
}; };
exports.serialize = function(tree) { exports.serialize = function(tree,serialize) {
return "`" + tree.children[0].text + "`"; return "`" + serialize(tree.children) + "`";
} }
})(); })();

View File

@ -31,7 +31,7 @@ exports.parse = function() {
return [{type: "element", tag: "hr"}]; return [{type: "element", tag: "hr"}];
}; };
exports.serialize = function() { exports.serialize = function(tree,serialize) {
return "---\n"; return "---\n";
} }

View File

@ -131,7 +131,7 @@ exports.serializeParseTree = function serializeParseTree(tree,tiddlerType) {
var output = []; var output = [];
if($tw.utils.isArray(tree)) { if($tw.utils.isArray(tree)) {
$tw.utils.each(tree,function(node) { $tw.utils.each(tree,function(node) {
output.push(serializeParseTree(node)); output.push(serializeParseTree(node,tiddlerType));
}); });
} else { } else {
if(tree.type === "text") { if(tree.type === "text") {