We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c96e085 commit bee5368Copy full SHA for bee5368
lib/locals.js
@@ -3,6 +3,7 @@
3
const vm = require('vm')
4
const matchHelper = require('posthtml-match-helper')
5
const { render } = require('posthtml-render')
6
+const { match } = require('posthtml/lib/api')
7
8
// const code = 'module.exports = {a: 1}';
9
const ctx = vm.createContext({ module })
@@ -22,7 +23,7 @@ function scriptDataLocals (tree, options) {
22
23
const locals = {}
24
const localsAttr = options.localsAttr || 'locals'
25
- tree.match(matchHelper(`script[${localsAttr}]`), node => {
26
+ match.call(tree, matchHelper(`script[${localsAttr}]`), node => {
27
if (node.content) {
28
const code = render(node.content)
29
0 commit comments