diff options
Diffstat (limited to 'src/compiler/optimize')
-rw-r--r-- | src/compiler/optimize/doctype.ts | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/compiler/optimize/doctype.ts b/src/compiler/optimize/doctype.ts index a666876bf..fdf6c4078 100644 --- a/src/compiler/optimize/doctype.ts +++ b/src/compiler/optimize/doctype.ts @@ -8,26 +8,27 @@ export default function (_opts: { filename: string; fileID: string }): Optimizer html: { Element: { enter(node, parent, _key, index) { - if(node.name === '!doctype') { + if (node.name === '!doctype') { hasDoctype = true; } - if(node.name === 'html' && !hasDoctype) { + if (node.name === 'html' && !hasDoctype) { const dtNode = { - start: 0, end: 0, + start: 0, + end: 0, attributes: [{ type: 'Attribute', name: 'html', value: true, start: 0, end: 0 }], children: [], name: '!doctype', - type: 'Element' + type: 'Element', }; parent.children!.splice(index, 0, dtNode); hasDoctype = true; } - } - } - } + }, + }, + }, }, async finalize() { // Nothing happening here. - } - } -}
\ No newline at end of file + }, + }; +} |