Browse Source

Up type

ts-components
Artur Arseniev 4 years ago
parent
commit
f920da793a
  1. 2
      src/dom_components/model/types.ts
  2. 10
      src/parser/model/ParserHtml.ts

2
src/dom_components/model/types.ts

@ -189,7 +189,7 @@ export interface ComponentDefinitionDefined extends Omit<ComponentProperties, 'c
/** /**
* Children components. * Children components.
*/ */
components?: ComponentDefinitionDefined[]; components?: ComponentDefinitionDefined[] | ComponentDefinitionDefined;
traits?: Partial<TraitProperties>[]; traits?: Partial<TraitProperties>[];
[key: string]: any; [key: string]: any;
} }

10
src/parser/model/ParserHtml.ts

@ -205,12 +205,10 @@ export default (em?: EditorModel, config: ParserConfig = {}) => {
// just make it content of the current node // just make it content of the current node
if (nodeChild === 1 && firstChild.nodeType === 3) { if (nodeChild === 1 && firstChild.nodeType === 3) {
!model.type && (model.type = 'text'); !model.type && (model.type = 'text');
model.components = [ model.components = {
{ type: 'textnode',
type: 'textnode', content: firstChild.nodeValue,
content: firstChild.nodeValue, };
},
];
} else { } else {
model.components = this.parseNode(node, { model.components = this.parseNode(node, {
...opts, ...opts,

Loading…
Cancel
Save