mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-03-01 09:20:02 +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(" ");
|
}).join(" ");
|
||||||
// Children
|
// Children
|
||||||
var children = tree.children ? serialize(tree.children) : "";
|
var children = tree.children ? serialize(tree.children) : "";
|
||||||
|
var result = "";
|
||||||
// Self-closing tag
|
// Self-closing tag
|
||||||
if(tree.isSelfClosing) {
|
if(tree.isSelfClosing) {
|
||||||
return "<" + tag + (attributes ? " " + attributes : "") + " />";
|
result += "<" + tag + (attributes ? " " + attributes : "") + " />";
|
||||||
}
|
} else {
|
||||||
// Opening and closing tags
|
// Opening and closing tags
|
||||||
return "<" + tag + (attributes ? " " + attributes : "") + ">" + children + "</" + tag + ">";
|
result += "<" + tag + (attributes ? " " + attributes : "") + ">" + children + "</" + tag + ">";
|
||||||
|
}
|
||||||
|
if(tree.isBlock) {
|
||||||
|
result += "\n\n";
|
||||||
|
}
|
||||||
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
@ -9,3 +9,7 @@ This is an HTML5 aside element
|
|||||||
<$slider target="MyTiddler">
|
<$slider target="MyTiddler">
|
||||||
This is a widget invocation
|
This is a widget invocation
|
||||||
</$slider>
|
</$slider>
|
||||||
|
|
||||||
|
<$list filter="[tag[ExampleTag]sort[title]]" />
|
||||||
|
|
||||||
|
Plain text in next paragraph.
|
Loading…
x
Reference in New Issue
Block a user