Skip to content

Commit

Permalink
Stop removing <span>s. Fixes GrapesJS#291 and GrapesJS#341
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Dec 1, 2017
1 parent f695562 commit 4a170af
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/parser/model/ParserHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,7 @@ module.exports = config => {
!model.type && (model.type = 'text');
model.content = firstChild.nodeValue;
} else {
const parsed = this.parseNode(node);
// From: <div> <span>TEST</span> </div> <-- span is text type
// TO: <div> TEST </div> <-- div become text type
if(parsed.length == 1 && parsed[0].type == 'text' &&
parsed[0].tagName == TEXT_NODE){
model.type = 'text';
model.content = parsed[0].content;
}else
model.components = parsed;
model.components = this.parseNode(node);
}
}

Expand Down

0 comments on commit 4a170af

Please sign in to comment.