Skip to content

Commit 6451e6e

Browse files
authored
Merge pull request mientjan#41 from mientjan/feature/expose-meta-torender-nodes
Feature/expose meta torender nodes
2 parents 3cc6da9 + ebf6340 commit 6451e6e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/lib/util/tokensToAST.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import getTokenTypeByToken from './getTokenTypeByToken';
33

44
/**
55
*
6-
* @param {{type: string, tag:string, content: string, children: *, attrs: Array}} token
6+
* @param {{type: string, tag:string, content: string, children: *, attrs: Array, meta, info}} token
77
* @param {number} tokenIndex
88
* @return {{type: string, content, tokenIndex: *, index: number, attributes: {}, children: *}}
99
*/
@@ -18,13 +18,13 @@ function createNode(token, tokenIndex) {
1818
const [name, value] = curr;
1919
return { ...prev, [name]: value };
2020
}, {});
21-
2221
}
2322

24-
2523
return {
2624
type,
2725
sourceType: token.type,
26+
sourceInfo: token.info,
27+
sourceMeta: token.meta,
2828
key: getUniqueID(),
2929
content,
3030
tokenIndex,
@@ -34,7 +34,6 @@ function createNode(token, tokenIndex) {
3434
};
3535
}
3636

37-
3837
/**
3938
*
4039
* @param {Array<{type: string, tag:string, content: string, children: *, attrs: Array}>}tokens

0 commit comments

Comments
 (0)