From 6fc7fbc8f295de2c7bf4c2be058c4c97f4f942f6 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 26 Oct 2017 16:36:34 +1000 Subject: [PATCH] remove unwanted whitespace in paste filter libreoffice adds newlines to exported HTML which interfere with cloze deletion --- web/editor.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/editor.js b/web/editor.js index 8c5ef7fc3..eab1ffe6c 100644 --- a/web/editor.js +++ b/web/editor.js @@ -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;