Skip to content

Commit

Permalink
Rename option removeEmptyTextNodes -> keepEmptyTextNodes
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Apr 12, 2018
1 parent 4fdc7df commit f3f3bb4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/editor/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/parser/model/ParserHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f3f3bb4

Please sign in to comment.