diff --git a/changelog.md b/changelog.md index 8ad4f85..90a56a5 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,12 @@ +## [1.8.1](https://github.com/posthtml/posthtml-expressions/compare/v1.8.0...v1.8.1) (2021-08-10) + + +### Bug Fixes + +* tree.match is not a function ([bee5368](https://github.com/posthtml/posthtml-expressions/commit/bee5368149d7f1258833656f91355e1266f6ee4d)) + + + # [1.8.0](https://github.com/posthtml/posthtml-expressions/compare/v1.7.1...v1.8.0) (2021-08-09) diff --git a/lib/locals.js b/lib/locals.js index d745a92..081405b 100644 --- a/lib/locals.js +++ b/lib/locals.js @@ -3,6 +3,7 @@ const vm = require('vm') const matchHelper = require('posthtml-match-helper') const { render } = require('posthtml-render') +const { match } = require('posthtml/lib/api') // const code = 'module.exports = {a: 1}'; const ctx = vm.createContext({ module }) @@ -22,7 +23,7 @@ function scriptDataLocals (tree, options) { const locals = {} const localsAttr = options.localsAttr || 'locals' - tree.match(matchHelper(`script[${localsAttr}]`), node => { + match.call(tree, matchHelper(`script[${localsAttr}]`), node => { if (node.content) { const code = render(node.content) diff --git a/package-lock.json b/package-lock.json index 07a4b2f..4149619 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "posthtml-expressions", - "version": "1.8.0", + "version": "1.8.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9e9c458..cba9672 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "posthtml-expressions", - "version": "1.8.0", + "version": "1.8.1", "description": "Expressions Plugin for PostHTML", "engines": { "node": ">=10"