Skip to content

Commit 3f3d261

Browse files
authored
Merge pull request #119 from posthtml/milestone-1.8.1
fix: tree.match is not a function
2 parents c96e085 + ca6a8d1 commit 3f3d261

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [1.8.1](https://github.com/posthtml/posthtml-expressions/compare/v1.8.0...v1.8.1) (2021-08-10)
2+
3+
4+
### Bug Fixes
5+
6+
* tree.match is not a function ([bee5368](https://github.com/posthtml/posthtml-expressions/commit/bee5368149d7f1258833656f91355e1266f6ee4d))
7+
8+
9+
110
# [1.8.0](https://github.com/posthtml/posthtml-expressions/compare/v1.7.1...v1.8.0) (2021-08-09)
211

312

lib/locals.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const vm = require('vm')
44
const matchHelper = require('posthtml-match-helper')
55
const { render } = require('posthtml-render')
6+
const { match } = require('posthtml/lib/api')
67

78
// const code = 'module.exports = {a: 1}';
89
const ctx = vm.createContext({ module })
@@ -22,7 +23,7 @@ function scriptDataLocals (tree, options) {
2223
const locals = {}
2324
const localsAttr = options.localsAttr || 'locals'
2425

25-
tree.match(matchHelper(`script[${localsAttr}]`), node => {
26+
match.call(tree, matchHelper(`script[${localsAttr}]`), node => {
2627
if (node.content) {
2728
const code = render(node.content)
2829

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "posthtml-expressions",
3-
"version": "1.8.0",
3+
"version": "1.8.1",
44
"description": "Expressions Plugin for PostHTML",
55
"engines": {
66
"node": ">=10"

0 commit comments

Comments
 (0)