diff --git a/lib/index.js b/lib/index.js index 36f4fef..b7afc86 100644 --- a/lib/index.js +++ b/lib/index.js @@ -13,7 +13,7 @@ module.exports = function ReshapeParser (input, options = {}) { if (sid) { tag += ` "${sid}"` } tag += '>' - const node = { type: 'text', content: tag } + const node = { type: 'doctype', content: tag } addLocation(node, location, options) result.push(node) diff --git a/test/index.js b/test/index.js index eaf7b19..375447e 100644 --- a/test/index.js +++ b/test/index.js @@ -19,7 +19,7 @@ test('head/body', t => { const str = '

hi!

' const out = parser(str) - t.truthy(out[0].type === 'text') + t.truthy(out[0].type === 'doctype') t.truthy(out[0].content.match(/!DOCTYPE/)) t.truthy(out[1].name === 'html') t.truthy(out[1].content[0].name === 'head')