remove unwanted whitespace in paste filter

libreoffice adds newlines to exported HTML which interfere with cloze
deletion
This commit is contained in:
Damien Elmes 2017-10-26 16:36:34 +10:00
parent a4d32a1200
commit 6fc7fbc8f2

View file

@ -314,6 +314,8 @@ var filterHTML = function (html, internal, extendedMode) {
filterNode(top, extendedMode);
}
var outHtml = top.innerHTML;
// remove newlines in HTML, as they break cloze deletions, and collapse whitespace
outHtml = outHtml.replace(/[\n\t ]+/g, " ").trim();
//console.log(`input html: ${html}`);
//console.log(`outpt html: ${outHtml}`);
return outHtml;