1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-02-06 22:20:02 +00:00

Text-slicer: Retain text outside paragraphs

This commit is contained in:
Jermolene 2018-01-11 12:43:24 +00:00
parent 4e433966f4
commit 92870c0b2d

View File

@ -361,6 +361,11 @@ Slicer.prototype.onEnd = function() {
Slicer.prototype.addTextToCurrentChunk = function(str,field) { Slicer.prototype.addTextToCurrentChunk = function(str,field) {
field = field || "text"; field = field || "text";
if(this.currentChunk === null && str.trim() !== "") {
this.startNewChunk({
"toc-type": "paragraph"
});
}
if(this.currentChunk !== null) { if(this.currentChunk !== null) {
this.chunks[this.currentChunk][field] += str; this.chunks[this.currentChunk][field] += str;
} }