diff --git a/src/dom_components/model/ComponentWrapper.ts b/src/dom_components/model/ComponentWrapper.ts index 71a0552a1..ba9f66f4f 100644 --- a/src/dom_components/model/ComponentWrapper.ts +++ b/src/dom_components/model/ComponentWrapper.ts @@ -13,7 +13,6 @@ export default class ComponentWrapper extends Component { draggable: false, components: [], traits: [], - // In case we might need the doctype as component https://stackoverflow.com/a/10162353 doctype: '', head: null, stylable: [ diff --git a/src/parser/config/config.ts b/src/parser/config/config.ts index ceaa7b437..06ea3b856 100644 --- a/src/parser/config/config.ts +++ b/src/parser/config/config.ts @@ -1,3 +1,5 @@ +import { CssRuleJSON } from '../../css_composer/model/CssRule'; +import { ComponentDefinitionDefined } from '../../dom_components/model/types'; import Editor from '../../editor'; export interface ParsedCssRule { @@ -11,6 +13,18 @@ export type CustomParserCss = (input: string, editor: Editor) => ParsedCssRule[] export type CustomParserHtml = (input: string, options: HTMLParserOptions) => HTMLElement; +export interface HTMLParseResult { + html: ComponentDefinitionDefined | ComponentDefinitionDefined[]; + css?: CssRuleJSON[]; + doctype?: string; + root?: ComponentDefinitionDefined; + head?: ComponentDefinitionDefined; +} + +export interface ParseNodeOptions extends HTMLParserOptions { + inSvg?: boolean; +} + export interface HTMLParserOptions { /** * DOMParser mime type. @@ -20,6 +34,12 @@ export interface HTMLParserOptions { */ htmlType?: DOMParserSupportedType; + /** + * Parse the string as HTML document. The result will include additional data (eg. doctype, head, etc.) + * @default false + */ + asDocument?: boolean; + /** * Allow + + +
+