Skip to content

Commit 2db3daa

Browse files
authored
Merge pull request #98 from posthtml/milestone-1.4.7
Milestone 1.4.7
2 parents be49a5e + 7ca4193 commit 2db3daa

File tree

7 files changed

+31
-10
lines changed

7 files changed

+31
-10
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [1.4.7](https://github.com/posthtml/posthtml-expressions/compare/v1.4.6...v1.4.7) (2020-08-28)
2+
3+
4+
### Bug Fixes
5+
6+
* options for parser when nnormalize, close [#97](https://github.com/posthtml/posthtml-expressions/issues/97) ([99c0281](https://github.com/posthtml/posthtml-expressions/commit/99c02815facfcb692d52f37b3d80ad882f4756fb))
7+
8+
9+
110
## [1.4.6](https://github.com/posthtml/posthtml-expressions/compare/v1.4.5...v1.4.6) (2020-08-23)
211

312

lib/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ module.exports = function postHTMLExpressions (options) {
155155

156156
// kick off the parsing
157157
return function (tree) {
158-
return normalizeTree(clearRawTag(walk({ locals: options.locals }, tree)))
158+
return normalizeTree(clearRawTag(walk({ locals: options.locals }, tree)), tree.options)
159159
}
160160
}
161161

@@ -414,6 +414,6 @@ function clearRawTag (tree) {
414414
return m
415415
}, [])
416416
}
417-
function normalizeTree (tree) {
418-
return parser(render(tree))
417+
function normalizeTree (tree, options) {
418+
return parser(render(tree), options)
419419
}

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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"name": "posthtml-expressions",
3-
"version": "1.4.6",
3+
"version": "1.4.7",
44
"description": "Expressions Plugin for PostHTML",
55
"engines": {
66
"node": ">=10"
77
},
88
"main": "lib",
99
"scripts": {
1010
"lint": "standard",
11-
"test": "nyc ava",
12-
"version": "standard-changelog -i CHANGELOG.md -w",
11+
"test": "nyc ava --timeout=1m",
12+
"version": "standard-changelog -i CHANGELOG.md -w && git add CHANGELOG.md && git commit -m \"build: update changelog\"",
1313
"docs": "jsdoc2md lib/*.js > INDEX.md",
1414
"clean": "rm -rf .nyc_output coverage jsdoc-api dmd",
15-
"start": "sudo npm run clean && npm run lint && sudo npm test"
15+
"start": "npm run clean && npm run lint && npm test"
1616
},
1717
"dependencies": {
1818
"fclone": "^1.0.11",

test/expect/directives.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php echo $myVar; ?>

test/fixtures/directives.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php echo $myVar; ?>

test/test-core.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ const expect = (file) => {
1515
return readSync(join(__dirname, 'expect', `${file}.html`), 'utf8')
1616
}
1717

18-
function process (t, name, options, log = false, plugins = [expressions(options)]) {
18+
function process (t, name, options, log = false, plugins = [expressions(options)], processOptions = {}) {
1919
return posthtml(plugins)
20-
.process(fixture(name))
20+
.process(fixture(name), processOptions)
2121
.then((result) => {
2222
log && console.log(result.html)
2323

@@ -89,3 +89,13 @@ test('Raw output - custom tag', (t) => {
8989
test('Boolean attribute', (t) => {
9090
return process(t, 'boolean_attr', null, false, [beautify(), expressions()])
9191
})
92+
93+
test('Directives options', (t) => {
94+
return process(t, 'directives', null, false, [expressions()], {
95+
directives: [{
96+
name: '?php',
97+
start: '<',
98+
end: '>',
99+
}]
100+
})
101+
})

0 commit comments

Comments
 (0)