@yozora/tokenizer-list 2.0.6 → 2.1.0
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/types/index.d.ts +3 -3
- package/package.json +5 -5
- package/src/match.ts +2 -2
- package/src/types.ts +4 -4
package/lib/types/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TaskStatus, NodeType, ListType, List } from '@yozora/ast';
|
|
2
|
-
import {
|
|
2
|
+
import { IPartialBlockToken, IBlockToken, IBaseBlockTokenizerProps, ITokenizer, BaseBlockTokenizer, IBlockTokenizer, IMatchBlockHookCreator, IParseBlockHookCreator } from '@yozora/core-tokenizer';
|
|
3
3
|
|
|
4
4
|
type T = ListType;
|
|
5
5
|
type INode = List;
|
|
6
6
|
declare const uniqueName = "@yozora/tokenizer-list";
|
|
7
|
-
interface IToken extends
|
|
7
|
+
interface IToken extends IPartialBlockToken<T> {
|
|
8
8
|
/**
|
|
9
9
|
* Is it an ordered list item.
|
|
10
10
|
*/
|
|
@@ -38,7 +38,7 @@ interface IToken extends IPartialYastBlockToken<T> {
|
|
|
38
38
|
/**
|
|
39
39
|
* Child token nodes.
|
|
40
40
|
*/
|
|
41
|
-
children:
|
|
41
|
+
children: IBlockToken[];
|
|
42
42
|
}
|
|
43
43
|
interface IThis extends ITokenizer {
|
|
44
44
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozora/tokenizer-list",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "guanghechen",
|
|
6
6
|
"url": "https://github.com/guanghechen/"
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"test": "cross-env TS_NODE_FILES=true NODE_OPTIONS=--experimental-vm-modules jest --config ../../jest.config.mjs --rootDir ."
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@yozora/ast": "^2.0
|
|
43
|
-
"@yozora/character": "^2.0
|
|
44
|
-
"@yozora/core-tokenizer": "^2.0
|
|
42
|
+
"@yozora/ast": "^2.1.0",
|
|
43
|
+
"@yozora/character": "^2.1.0",
|
|
44
|
+
"@yozora/core-tokenizer": "^2.1.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "387a68e8f9154944e2a6a7009a808d076d0659c6"
|
|
47
47
|
}
|
package/src/match.ts
CHANGED
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
isWhitespaceCharacter,
|
|
11
11
|
} from '@yozora/character'
|
|
12
12
|
import type {
|
|
13
|
+
IBlockToken,
|
|
13
14
|
IMatchBlockHookCreator,
|
|
14
15
|
IPhrasingContentLine,
|
|
15
16
|
IResultOfEatAndInterruptPreviousSibling,
|
|
16
17
|
IResultOfEatContinuationText,
|
|
17
18
|
IResultOfEatOpener,
|
|
18
|
-
IYastBlockToken,
|
|
19
19
|
} from '@yozora/core-tokenizer'
|
|
20
20
|
import { calcEndPoint, calcStartPoint } from '@yozora/core-tokenizer'
|
|
21
21
|
import type { IThis, IToken, T } from './types'
|
|
@@ -247,7 +247,7 @@ export const match: IMatchBlockHookCreator<T, IToken, IThis> = function () {
|
|
|
247
247
|
|
|
248
248
|
function eatAndInterruptPreviousSibling(
|
|
249
249
|
line: Readonly<IPhrasingContentLine>,
|
|
250
|
-
prevSiblingToken: Readonly<
|
|
250
|
+
prevSiblingToken: Readonly<IBlockToken>,
|
|
251
251
|
): IResultOfEatAndInterruptPreviousSibling<T, IToken> {
|
|
252
252
|
/**
|
|
253
253
|
* ListItem can interrupt Paragraph
|
package/src/types.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { List, ListType, NodeType, TaskStatus } from '@yozora/ast'
|
|
2
2
|
import type {
|
|
3
3
|
IBaseBlockTokenizerProps,
|
|
4
|
-
|
|
4
|
+
IBlockToken,
|
|
5
|
+
IPartialBlockToken,
|
|
5
6
|
ITokenizer,
|
|
6
|
-
IYastBlockToken,
|
|
7
7
|
} from '@yozora/core-tokenizer'
|
|
8
8
|
|
|
9
9
|
export type T = ListType
|
|
10
10
|
export type INode = List
|
|
11
11
|
export const uniqueName = '@yozora/tokenizer-list'
|
|
12
12
|
|
|
13
|
-
export interface IToken extends
|
|
13
|
+
export interface IToken extends IPartialBlockToken<T> {
|
|
14
14
|
/**
|
|
15
15
|
* Is it an ordered list item.
|
|
16
16
|
*/
|
|
@@ -44,7 +44,7 @@ export interface IToken extends IPartialYastBlockToken<T> {
|
|
|
44
44
|
/**
|
|
45
45
|
* Child token nodes.
|
|
46
46
|
*/
|
|
47
|
-
children:
|
|
47
|
+
children: IBlockToken[]
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
export interface IThis extends ITokenizer {
|