@yozora/tokenizer-heading 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
@@ -83,14 +83,11 @@ const parse = function (api) {
83
83
  countOfPrecedeSpaces: 0,
84
84
  },
85
85
  ];
86
- const phrasingContent = api.buildPhrasingContent(lines);
87
- const children = phrasingContent == null ? [] : [phrasingContent];
88
- const node = {
89
- type: ast.HeadingType,
90
- position: token.position,
91
- depth: token.depth,
92
- children,
93
- };
86
+ const contents = coreTokenizer.mergeAndStripContentLines(lines);
87
+ const children = api.processInlines(contents);
88
+ const node = api.shouldReservePosition
89
+ ? { type: ast.HeadingType, position: token.position, depth: token.depth, children }
90
+ : { type: ast.HeadingType, depth: token.depth, children };
94
91
  return node;
95
92
  }),
96
93
  };
package/lib/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { HeadingType } from '@yozora/ast';
2
2
  import { AsciiCodePoint, isSpaceCharacter, calcTrimBoundaryOfCodePoints, isWhitespaceCharacter } from '@yozora/character';
3
- import { eatOptionalCharacters, calcStartYastNodePoint, calcEndYastNodePoint, BaseBlockTokenizer, TokenizerPriority } from '@yozora/core-tokenizer';
3
+ import { eatOptionalCharacters, calcStartYastNodePoint, calcEndYastNodePoint, mergeAndStripContentLines, BaseBlockTokenizer, TokenizerPriority } from '@yozora/core-tokenizer';
4
4
 
5
5
  const match = function () {
6
6
  return {
@@ -79,14 +79,11 @@ const parse = function (api) {
79
79
  countOfPrecedeSpaces: 0,
80
80
  },
81
81
  ];
82
- const phrasingContent = api.buildPhrasingContent(lines);
83
- const children = phrasingContent == null ? [] : [phrasingContent];
84
- const node = {
85
- type: HeadingType,
86
- position: token.position,
87
- depth: token.depth,
88
- children,
89
- };
82
+ const contents = mergeAndStripContentLines(lines);
83
+ const children = api.processInlines(contents);
84
+ const node = api.shouldReservePosition
85
+ ? { type: HeadingType, position: token.position, depth: token.depth, children }
86
+ : { type: HeadingType, depth: token.depth, children };
90
87
  return node;
91
88
  }),
92
89
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yozora/tokenizer-heading",
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
  }