Browse Source

Allow skipping nodes during HTML parsing

type-event-callbacks
Artur Arseniev 3 months ago
parent
commit
403a38debf
  1. 2
      packages/core/src/parser/model/ParserHtml.ts

2
packages/core/src/parser/model/ParserHtml.ts

@ -206,7 +206,7 @@ const ParserHtml = (em?: EditorModel, config: ParserConfig & { returnArray?: boo
const nodesLen = nodes.length;
let model = this.detectNode(node, opts);
if (!model.tagName) {
if (!model.tagName && model.tagName !== '') {
const tag = node.tagName || '';
const ns = node.namespaceURI || '';
model.tagName = tag && ns === 'http://www.w3.org/1999/xhtml' ? tag.toLowerCase() : tag;

Loading…
Cancel
Save