rehype-document
Advanced tools
Comparing version 3.2.0 to 3.2.1
14
index.js
@@ -29,3 +29,3 @@ 'use strict' | ||
var title = settings.title || file.stem | ||
var body = tree.children.concat() | ||
var contents = tree.type === 'root' ? tree.children.concat() : [tree] | ||
var head = [line(), h('meta', {charset: 'utf-8'})] | ||
@@ -35,4 +35,4 @@ var length | ||
if (body.length !== 0) { | ||
body.unshift(line()) | ||
if (contents.length !== 0) { | ||
contents.unshift(line()) | ||
} | ||
@@ -80,3 +80,3 @@ | ||
while (++index < length) { | ||
body.push(line(), h('script', scripts[index])) | ||
contents.push(line(), h('script', scripts[index])) | ||
} | ||
@@ -88,6 +88,6 @@ | ||
while (++index < length) { | ||
body.push(line(), h('script', {src: js[index]})) | ||
contents.push(line(), h('script', {src: js[index]})) | ||
} | ||
body.push(line()) | ||
contents.push(line()) | ||
@@ -101,3 +101,3 @@ return u('root', [ | ||
line(), | ||
h('body', body), | ||
h('body', contents), | ||
line() | ||
@@ -104,0 +104,0 @@ ]), |
{ | ||
"name": "rehype-document", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"description": "rehype plugin to wrap a document around a fragment", | ||
@@ -17,2 +17,6 @@ "license": "MIT", | ||
"bugs": "https://github.com/rehypejs/rehype-document/issues", | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/unified" | ||
}, | ||
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)", | ||
@@ -19,0 +23,0 @@ "contributors": [ |
10567