From f6907c5fadbbf77a930b57470dba4c4f2d3be246 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 29 Mar 2020 12:09:33 +0000 Subject: [PATCH] contentcollector: remove weird stuff LibreOffice adds to DOM before importing --- src/static/js/contentcollector.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js index 7e169170b..446113a13 100644 --- a/src/static/js/contentcollector.js +++ b/src/static/js/contentcollector.js @@ -526,6 +526,16 @@ function makeContentCollector(collectStyles, abrowser, apool, domInterface, clas if (isPre) cc.incrementFlag(state, 'preMode'); var oldListTypeOrNull = null; var oldAuthorOrNull = null; + + // LibreOffice Writer puts in weird items during import or copy/paste, we should drop them. + if (cls === "Numbering_20_Symbols" || cls === "Bullet_20_Symbols") { + styl = null; + cls = null; + + // We have to return here but this could break things in the future, for now it shows how to fix the problem + return; + } + if (collectStyles) { hooks.callAll('collectContentPre', {