Skip to content

Commit 33e10de

Browse files
committed
fix: tree.walk api
1 parent 7fc1c11 commit 33e10de

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ const srcset = require('srcset')
22
const postcss = require('postcss')
33
const merge = require('lodash.merge')
44
const isUrl = require('is-url-superb')
5+
const {walk} = require('posthtml/lib/api')
56
const postcssBaseUrl = require('./plugins/postcss-baseurl.js')
7+
68
const defaultTags = {
79
a: {
810
href: true,
@@ -67,6 +69,8 @@ module.exports = (options = {}) => tree => {
6769
options.inlineCss = options.inlineCss || false
6870
options.tags = options.allTags ? merge(defaultTags, options.tags) : options.tags || {}
6971

72+
tree.walk = tree.walk || walk
73+
7074
const process = node => {
7175
// Skip if `url` was not provided
7276
if (options.url && (typeof options.url !== 'string' || options.url === '')) {

0 commit comments

Comments
 (0)