mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-07 16:00:28 +00:00
feat: allow recursive
This commit is contained in:
parent
84e27c05b9
commit
078967c830
@ -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";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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) + "`";
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
@ -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";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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") {
|
||||||
|
Loading…
Reference in New Issue
Block a user