Browse Source

Stop removing `<span>`s. Fixes #291 and #341

pull/600/head
Artur Arseniev 9 years ago
parent
commit
4a170af46c
  1. 10
      src/parser/model/ParserHtml.js

10
src/parser/model/ParserHtml.js

@ -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);
}
}

Loading…
Cancel
Save