From 275a7d31e0949aeccc40e4412db5f76da0f06f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20T=C3=A9tard?= Date: Mon, 27 Jul 2015 16:38:57 +0200 Subject: [PATCH] Avoid space removal when pasting text from word processor. Since bf380eea504662ea41aa431e30d7e30ad6a36cd3, some spaces were removed when pasting text from a word processor (at least using Libre Office). To avoid double space creations and space removal, we only remove line break which are tight to a space character. --- src/static/js/contentcollector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js index 5c1e8efb..6820da07 100644 --- a/src/static/js/contentcollector.js +++ b/src/static/js/contentcollector.js @@ -100,7 +100,7 @@ function makeContentCollector(collectStyles, abrowser, apool, domInterface, clas function textify(str) { return sanitizeUnicode( - str.replace(/\n/g, '').replace(/[\n\r ]/g, ' ').replace(/\xa0/g, ' ').replace(/\t/g, ' ')); + str.replace(/(\n | \n)/g, ' ').replace(/[\n\r ]/g, ' ').replace(/\xa0/g, ' ').replace(/\t/g, ' ')); } function getAssoc(node, name)