File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -20,20 +20,26 @@ module.exports = (options = {}) => {
2020 let content ;
2121 let subtree ;
2222 let source ;
23- let locals = false ;
23+ const posthtmlExpressionsOptions = {
24+ locals : false
25+ }
26+
27+ if ( options . delimiters ) {
28+ posthtmlExpressionsOptions . delimiters = options . delimiters ;
29+ }
2430
2531 if ( src ) {
2632 src = path . resolve ( options . root , src ) ;
2733 source = fs . readFileSync ( src , options . encoding ) ;
2834
2935 try {
3036 const localsRaw = node . attrs . locals || ( node . content ? node . content . join ( ) . replace ( / \n / g, '' ) : false ) ;
31- locals = JSON . parse ( localsRaw ) ;
37+ posthtmlExpressionsOptions . locals = JSON . parse ( localsRaw ) ;
3238 } catch { }
3339
34- if ( locals ) {
40+ if ( posthtmlExpressionsOptions . locals ) {
3541 const result = posthtml ( )
36- . use ( expressions ( { locals } ) )
42+ . use ( expressions ( posthtmlExpressionsOptions ) )
3743 . process ( source , { sync : true } ) ;
3844 source = result . html ;
3945 }
You can’t perform that action at this time.
0 commit comments