1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-08-08 06:43:49 +00:00

fix: table space and horizrule block new line

This commit is contained in:
lin onetwo 2024-10-13 21:31:51 +08:00
parent 72dd18dfa5
commit fb9f7a5ea1
5 changed files with 19 additions and 11 deletions

View File

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

View File

@ -32,7 +32,7 @@ exports.parse = function() {
}; };
exports.serialize = function(tree,serialize) { exports.serialize = function(tree,serialize) {
return "---\n"; return "---\n\n";
} }
})(); })();

View File

@ -205,17 +205,17 @@ exports.serialize = function(tree, serialize) {
if(cell.tag === "th") { if(cell.tag === "th") {
serialized += "!"; serialized += "!";
} }
// Serialize the cell content // Cell content
serialized += serialize(cell.children); serialized += serialize(cell.children);
// End the cell with a tailing space // End the cell
serialized += " |"; serialized += "|";
} }
// End the row // End the row
serialized += "\n"; serialized += "\n";
} }
} }
// Return the complete serialized string // Return the completed block
return serialized; return serialized + "\n";
}; };
})(); })();

View File

@ -9,4 +9,9 @@ Simple `JS` and complex
```js ```js
var match = reEnd.exec(this.parser.source) var match = reEnd.exec(this.parser.source)
``` ```
```tid
<$list filter="[tag[ExampleTag]sort[title]]"/>
```
end end

View File

@ -2,7 +2,10 @@ tags: $:/tags/wikitext-serialize-test-spec
title: Serialize/Table title: Serialize/Table
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
|! |!Alpha |!Beta |!Gamma |!Delta | |!|!Alpha|!Beta|!Gamma|!Delta|
|!One | | | | | |!One|||||
|!Two | | | | | |!Two|||||
|!Three | | | | | |!Three|||||
|cell one|cell two|
|cell three|cell four|