Browse Source

Rename option `removeEmptyTextNodes` -> `keepEmptyTextNodes`

pull/1045/head
Artur Arseniev 8 years ago
parent
commit
f3f3bb4a6e
  1. 4
      src/editor/config/config.js
  2. 2
      src/editor/index.js
  3. 2
      src/parser/model/ParserHtml.js

4
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,

2
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

2
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;

Loading…
Cancel
Save