From f3f3bb4a6e076c50dfdf7ea7e964858fe9b491e4 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 12 Apr 2018 23:50:23 +0200 Subject: [PATCH] Rename option `removeEmptyTextNodes` -> `keepEmptyTextNodes` --- src/editor/config/config.js | 4 ++-- src/editor/index.js | 2 +- src/parser/model/ParserHtml.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/editor/config/config.js b/src/editor/config/config.js index c024ea1f3..23153cca2 100644 --- a/src/editor/config/config.js +++ b/src/editor/config/config.js @@ -96,8 +96,8 @@ module.exports = { // Ending tag for variable inside scripts in Components tagVarEnd: ' ]}', - // Remove empty text nodes when parsed, unless they contain a space - removeEmptyTextNodes: true, + // When false, removes empty text nodes when parsed, unless they contain a space + keepEmptyTextNodes: 0, // Return JS of components inside HTML from 'editor.getHtml()' jsInHtml: true, diff --git a/src/editor/index.js b/src/editor/index.js index 2dc9d15e1..2ed623729 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -87,7 +87,7 @@ * @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 {Boolean} [config.keepEmptyTextNodes=false] If false, 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 0f56df1f5..aa7fe369f 100644 --- a/src/parser/model/ParserHtml.js +++ b/src/parser/model/ParserHtml.js @@ -153,7 +153,7 @@ module.exports = config => { } // Throw away empty nodes (keep spaces) - if (config.removeEmptyTextNodes) { + if (!config.keepEmptyTextNodes) { const content = node.nodeValue; if (content != ' ' && !content.trim()) { continue;