mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-30 05:19:57 +00:00
feat: add \n\n based on isBlock, if could also be inline
This commit is contained in:
parent
0f385675c2
commit
f220dacdd8
@ -202,12 +202,18 @@ exports.serialize = function(tree,serialize) {
|
||||
}).join(" ");
|
||||
// Children
|
||||
var children = tree.children ? serialize(tree.children) : "";
|
||||
var result = "";
|
||||
// Self-closing tag
|
||||
if(tree.isSelfClosing) {
|
||||
return "<" + tag + (attributes ? " " + attributes : "") + " />";
|
||||
result += "<" + tag + (attributes ? " " + attributes : "") + " />";
|
||||
} else {
|
||||
// Opening and closing tags
|
||||
result += "<" + tag + (attributes ? " " + attributes : "") + ">" + children + "</" + tag + ">";
|
||||
}
|
||||
// Opening and closing tags
|
||||
return "<" + tag + (attributes ? " " + attributes : "") + ">" + children + "</" + tag + ">";
|
||||
if(tree.isBlock) {
|
||||
result += "\n\n";
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
})();
|
||||
|
@ -8,4 +8,8 @@ This is an HTML5 aside element
|
||||
|
||||
<$slider target="MyTiddler">
|
||||
This is a widget invocation
|
||||
</$slider>
|
||||
</$slider>
|
||||
|
||||
<$list filter="[tag[ExampleTag]sort[title]]" />
|
||||
|
||||
Plain text in next paragraph.
|
Loading…
Reference in New Issue
Block a user