Skip to content

Commit

Permalink
Merge pull request GrapesJS#1017 from artf/revert-1010-master
Browse files Browse the repository at this point in the history
Revert "implemented removeEmptyTextNodes boolean, fixes GrapesJS#989"
  • Loading branch information
artf authored Apr 8, 2018
2 parents 28c9fe7 + f823b5e commit cd5fdbf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
3 changes: 0 additions & 3 deletions src/editor/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
1 change: 0 additions & 1 deletion src/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 3 additions & 6 deletions src/parser/model/ParserHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ module.exports = config => {
* @return {Array<Object>}
*/
parseNode(el) {
const config = (c.em && c.em.get('Config')) || {};
const result = [];
const nodes = el.childNodes;

Expand Down Expand Up @@ -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;
}
}

Expand Down

0 comments on commit cd5fdbf

Please sign in to comment.