Browse Source

Improve void elements for xml parser

pull/3691/head
Artur Arseniev 5 years ago
parent
commit
447d147df2
  1. 3
      src/dom_components/config/config.js
  2. 5
      src/parser/model/ParserHtml.js

3
src/dom_components/config/config.js

@ -35,7 +35,8 @@ export default {
*/
processor: 0,
// List of void elements
// List of HTML void elements
// https://www.w3.org/TR/2011/WD-html-markup-20110113/syntax.html#void-elements
voidElements: [
'area',
'base',

5
src/parser/model/ParserHtml.js

@ -232,6 +232,11 @@ export default config => {
}
}
// Check for custom void elements (valid in XML)
if (!nodeChild && `${node.outerHTML}`.slice(-2) === '/>') {
model.void = true;
}
// If all children are texts and there is some textnode the parent should
// be text too otherwise I'm unable to edit texnodes
const comps = model.components;

Loading…
Cancel
Save