Skip to content

Commit 83ae5f6

Browse files
authored
Merge pull request #94 from posthtml/milestone-1.4.5
Milestone 1.4.5
2 parents 9efb08c + 64a2d13 commit 83ae5f6

File tree

5 files changed

+152
-86
lines changed

5 files changed

+152
-86
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.5](https://github.com/posthtml/posthtml-expressions/compare/v1.4.4...v1.4.5) (2020-07-07)
2+
3+
4+
### Bug Fixes
5+
6+
* normalize output tree, close [#93](https://github.com/posthtml/posthtml-expressions/issues/93) ([5d820e5](https://github.com/posthtml/posthtml-expressions/commit/5d820e59e0f745444015220937d3e3321071249e))
7+
8+
9+
110
## [1.4.4](https://github.com/posthtml/posthtml-expressions/compare/v1.4.3...v1.4.4) (2020-06-30)
211

312

lib/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict'
22

33
const vm = require('vm')
4+
const parser = require('posthtml-parser')
5+
const render = require('posthtml-render')
46

57
const getNextTag = require('./tags')
68
const parseLoopStatement = require('./loops')
@@ -153,7 +155,7 @@ module.exports = function postHTMLExpressions (options) {
153155

154156
// kick off the parsing
155157
return function (tree) {
156-
return clearRawTag(walk({ locals: options.locals }, tree))
158+
return normalizeTree(clearRawTag(walk({ locals: options.locals }, tree)))
157159
}
158160
}
159161

@@ -412,3 +414,6 @@ function clearRawTag (tree) {
412414
return m
413415
}, [])
414416
}
417+
function normalizeTree (tree) {
418+
return parser(render(tree))
419+
}

0 commit comments

Comments
 (0)