diff --git a/core/modules/parsers/wikiparser/rules/html.js b/core/modules/parsers/wikiparser/rules/html.js index 53a5139c5..39ea1e141 100644 --- a/core/modules/parsers/wikiparser/rules/html.js +++ b/core/modules/parsers/wikiparser/rules/html.js @@ -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 + ""; } - // Opening and closing tags - return "<" + tag + (attributes ? " " + attributes : "") + ">" + children + ""; + if(tree.isBlock) { + result += "\n\n"; + } + return result; }; })(); diff --git a/editions/test/tiddlers/tests/data/serialize/Html.tid b/editions/test/tiddlers/tests/data/serialize/Html.tid index 05507eb56..d4a8db414 100644 --- a/editions/test/tiddlers/tests/data/serialize/Html.tid +++ b/editions/test/tiddlers/tests/data/serialize/Html.tid @@ -8,4 +8,8 @@ This is an HTML5 aside element <$slider target="MyTiddler"> This is a widget invocation - \ No newline at end of file + + +<$list filter="[tag[ExampleTag]sort[title]]" /> + +Plain text in next paragraph. \ No newline at end of file