Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 1, 2021
1 parent 24e00c4 commit b433d4d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
22 changes: 11 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import rehypeMinifyWhitespace from 'rehype-minify-whitespace'
import visit from 'unist-util-visit-parents'
import embedded from 'hast-util-embedded'
import phrasing from 'hast-util-phrasing'
import whitespace from 'hast-util-whitespace'
import is from 'hast-util-is-element'
import {visitParents, SKIP} from 'unist-util-visit-parents'
import {embedded} from 'hast-util-embedded'
import {phrasing} from 'hast-util-phrasing'
import {whitespace} from 'hast-util-whitespace'
import {isElement} from 'hast-util-is-element'
import {whitespaceSensitiveTagNames} from 'html-whitespace-sensitive-tag-names'
import repeat from 'repeat-string'

Expand All @@ -30,7 +30,7 @@ export default function rehypeFormat(options) {

minify(tree)

visit(tree, visitor)
visitParents(tree, visitor)

function visitor(node, parents) {
var children = node.children || []
Expand All @@ -41,16 +41,16 @@ export default function rehypeFormat(options) {
var child
var eol

if (is(node, 'head')) {
if (isElement(node, 'head')) {
head = true
}

if (head && is(node, 'body')) {
if (head && isElement(node, 'body')) {
head = null
}

if (is(node, whitespaceSensitiveTagNames)) {
return visit.SKIP
if (isElement(node, whitespaceSensitiveTagNames)) {
return SKIP
}

// Don’t indent content of whitespace-sensitive nodes / inlines.
Expand Down Expand Up @@ -136,7 +136,7 @@ function padding(node, head) {
return (
node.type === 'root' ||
(node.type === 'element'
? head || is(node, 'script') || embedded(node) || !phrasing(node)
? head || isElement(node, 'script') || embedded(node) || !phrasing(node)
: false)
)
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
"index.js"
],
"dependencies": {
"hast-util-embedded": "^1.0.0",
"hast-util-is-element": "^1.0.0",
"hast-util-phrasing": "^1.0.0",
"hast-util-whitespace": "^1.0.0",
"hast-util-embedded": "^2.0.0",
"hast-util-is-element": "^2.0.0",
"hast-util-phrasing": "^2.0.0",
"hast-util-whitespace": "^2.0.0",
"html-whitespace-sensitive-tag-names": "^2.0.0",
"rehype-minify-whitespace": "^4.0.0",
"rehype-minify-whitespace": "^5.0.0",
"repeat-string": "^1.0.0",
"unist-util-visit-parents": "^3.0.0"
"unist-util-visit-parents": "^5.0.0"
},
"devDependencies": {
"c8": "^7.0.0",
Expand Down

0 comments on commit b433d4d

Please sign in to comment.