Skip to content

Commit 5d3bdd3

Browse files
committed
Include from in subtree
1 parent 9442535 commit 5d3bdd3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ module.exports = (options = {}) => {
5757
}
5858

5959
subtree = tree.parser(source);
60+
subtree.options = subtree.options || {};
61+
subtree.options.from = path.isAbsolute(src)
62+
? src
63+
: tree.options.from
64+
? path.relative(tree.options.from, src)
65+
: src;
6066
subtree.match = tree.match;
6167
subtree.parser = tree.parser;
6268
subtree.messages = tree.messages;

0 commit comments

Comments
 (0)