From f823b5e9ebf87ff21f05877b59837674456faffd Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sun, 8 Apr 2018 13:57:01 +0200 Subject: [PATCH] Revert "implemented removeEmptyTextNodes boolean, fixes #989" --- src/editor/config/config.js | 3 --- src/editor/index.js | 1 - src/parser/model/ParserHtml.js | 9 +++------ 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/editor/config/config.js b/src/editor/config/config.js index cdf4b7b32f..09bd8f2b94 100644 --- a/src/editor/config/config.js +++ b/src/editor/config/config.js @@ -62,9 +62,6 @@ module.exports = { // Ending tag for variable inside scripts in Components tagVarEnd: ' ]}', - // Remove empty text nodes when parsed, unless they contain a space - removeEmptyTextNodes: true, - // Return JS of components inside HTML from 'editor.getHtml()' jsInHtml: true, diff --git a/src/editor/index.js b/src/editor/index.js index fa8db67f53..00ea2d4df3 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -80,7 +80,6 @@ * @param {Object} [config.domComponents={}] Components configuration, see the relative documentation * @param {Object} [config.panels={}] Panels configuration, see the relative documentation * @param {Object} [config.showDevices=true] If true render a select of available devices inside style manager panel - * @param {Boolean} [config.removeEmptyTextNodes=true] If true, removes empty text nodes when parsed, unless they contain a space * @param {string} [config.defaultCommand='select-comp'] Command to execute when no other command is running * @param {Array} [config.plugins=[]] Array of plugins to execute on start * @param {Object} [config.pluginsOpts={}] Custom options for plugins diff --git a/src/parser/model/ParserHtml.js b/src/parser/model/ParserHtml.js index c07ba3b4b8..021c5dbf9a 100644 --- a/src/parser/model/ParserHtml.js +++ b/src/parser/model/ParserHtml.js @@ -57,7 +57,6 @@ module.exports = config => { * @return {Array} */ parseNode(el) { - const config = (c.em && c.em.get('Config')) || {}; const result = []; const nodes = el.childNodes; @@ -153,11 +152,9 @@ module.exports = config => { } // Throw away empty nodes (keep spaces) - if (config.removeEmptyTextNodes !== false) { - const content = node.nodeValue; - if (content != ' ' && !content.trim()) { - continue; - } + const content = node.nodeValue; + if (content != ' ' && !content.trim()) { + continue; } }