File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,14 +9,22 @@ module.exports = function(options) {
99
1010 return function posthtmlInclude ( tree ) {
1111 tree . match ( { tag : 'include' } , function ( node ) {
12- var src = node . attrs . src || false ,
13- content ;
12+ var src = node . attrs . src || false ;
13+ var content ;
14+ var subtree ;
15+ var source ;
16+
1417 if ( src ) {
1518 src = path . resolve ( options . root , src ) ;
16- content = parser ( fs . readFileSync ( src , options . encoding ) ) ;
19+ source = fs . readFileSync ( src , options . encoding ) ;
20+ subtree = parser ( source ) ;
21+ subtree . match = tree . match ;
22+ content = source . indexOf ( 'include' ) !== - 1 ? posthtmlInclude ( subtree ) : subtree ;
1723
18- if ( typeof options . addDependencyTo === 'object' &&
19- typeof options . addDependencyTo . addDependency === 'function' ) {
24+ if (
25+ typeof options . addDependencyTo === 'object' &&
26+ typeof options . addDependencyTo . addDependency === 'function'
27+ ) {
2028 console . warn ( [
2129 "addDependencyTo is deprecated in favor of" ,
2230 "result.messages.dependency; posthtml-loader >= v1.0.1 will" ,
You can’t perform that action at this time.
0 commit comments