@yozora/tokenizer-footnote-definition 2.0.0-alpha.1 → 2.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cjs/index.js CHANGED
@@ -96,14 +96,21 @@ const parse = function (api) {
96
96
  parse: tokens => tokens.map(token => {
97
97
  const label = token._label;
98
98
  const identifier = token._identifier;
99
- const children = token.children ? api.parseBlockTokens(token.children) : [];
100
- const node = {
101
- type: ast.FootnoteDefinitionType,
102
- position: token.position,
103
- identifier,
104
- label,
105
- children,
106
- };
99
+ const children = api.parseBlockTokens(token.children);
100
+ const node = api.shouldReservePosition
101
+ ? {
102
+ type: ast.FootnoteDefinitionType,
103
+ position: token.position,
104
+ identifier,
105
+ label,
106
+ children,
107
+ }
108
+ : {
109
+ type: ast.FootnoteDefinitionType,
110
+ identifier,
111
+ label,
112
+ children,
113
+ };
107
114
  return node;
108
115
  }),
109
116
  };
package/lib/esm/index.js CHANGED
@@ -92,14 +92,21 @@ const parse = function (api) {
92
92
  parse: tokens => tokens.map(token => {
93
93
  const label = token._label;
94
94
  const identifier = token._identifier;
95
- const children = token.children ? api.parseBlockTokens(token.children) : [];
96
- const node = {
97
- type: FootnoteDefinitionType,
98
- position: token.position,
99
- identifier,
100
- label,
101
- children,
102
- };
95
+ const children = api.parseBlockTokens(token.children);
96
+ const node = api.shouldReservePosition
97
+ ? {
98
+ type: FootnoteDefinitionType,
99
+ position: token.position,
100
+ identifier,
101
+ label,
102
+ children,
103
+ }
104
+ : {
105
+ type: FootnoteDefinitionType,
106
+ identifier,
107
+ label,
108
+ children,
109
+ };
103
110
  return node;
104
111
  }),
105
112
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yozora/tokenizer-footnote-definition",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.2",
4
4
  "author": {
5
5
  "name": "guanghechen",
6
6
  "url": "https://github.com/guanghechen/"
@@ -35,9 +35,9 @@
35
35
  "test": "cross-env TS_NODE_FILES=true jest --config ../../jest.config.js --rootDir ."
36
36
  },
37
37
  "dependencies": {
38
- "@yozora/ast": "^2.0.0-alpha.1",
39
- "@yozora/character": "^2.0.0-alpha.1",
40
- "@yozora/core-tokenizer": "^2.0.0-alpha.1"
38
+ "@yozora/ast": "^2.0.0-alpha.2",
39
+ "@yozora/character": "^2.0.0-alpha.2",
40
+ "@yozora/core-tokenizer": "^2.0.0-alpha.2"
41
41
  },
42
- "gitHead": "86202e1d2b03ccfc2ab030517d9d314f7aee7666"
42
+ "gitHead": "da59d85520455c59a117a35032ef1a035c10ea21"
43
43
  }