Text-slicer: Retain text outside paragraphs

This commit is contained in:
Jermolene 2018-01-11 12:43:24 +00:00
parent 4e433966f4
commit 92870c0b2d
1 changed files with 5 additions and 0 deletions

View File

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