@yozora/tokenizer-list 2.0.0-alpha.2 → 2.0.0-alpha.3
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/README.md +2 -2
- package/lib/types/tokenizer.d.ts +2 -2
- package/lib/types/types.d.ts +6 -6
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -218,7 +218,7 @@ Name | Type | Required | Default
|
|
|
218
218
|
`name` | `string` | `false` | `"@yozora/tokenizer-list"`
|
|
219
219
|
`priority` | `number` | `false` | `TokenizerPriority.CONTAINING_BLOCK`
|
|
220
220
|
`enableTaskListItem` | `boolean` | `false` | `false`
|
|
221
|
-
`emptyItemCouldNotInterruptedTypes` | `
|
|
221
|
+
`emptyItemCouldNotInterruptedTypes` | `NodeType[]` | `false` | `[ParagraphType]`
|
|
222
222
|
|
|
223
223
|
* `name`: The unique name of the tokenizer, used to bind the token it generates,
|
|
224
224
|
to determine the tokenizer that should be called in each life cycle of the
|
|
@@ -231,7 +231,7 @@ Name | Type | Required | Default
|
|
|
231
231
|
|
|
232
232
|
* `enableTaskListItem`: Whether to enable task list item (extension).
|
|
233
233
|
|
|
234
|
-
* `emptyItemCouldNotInterruptedTypes`: Specify an array of
|
|
234
|
+
* `emptyItemCouldNotInterruptedTypes`: Specify an array of Node types that could not be
|
|
235
235
|
interrupted by this ITokenizer if the current list-item is empty.
|
|
236
236
|
|
|
237
237
|
@see https://github.github.com/gfm/#example-263
|
package/lib/types/tokenizer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NodeType } from '@yozora/ast';
|
|
2
2
|
import type { IBlockTokenizer, IMatchBlockHookCreator, IParseBlockHookCreator } from '@yozora/core-tokenizer';
|
|
3
3
|
import { BaseBlockTokenizer } from '@yozora/core-tokenizer';
|
|
4
4
|
import type { INode, IThis, IToken, ITokenizerProps, T } from './types';
|
|
@@ -14,7 +14,7 @@ import type { INode, IThis, IToken, ITokenizerProps, T } from './types';
|
|
|
14
14
|
export declare class ListTokenizer extends BaseBlockTokenizer<T, IToken, INode, IThis> implements IBlockTokenizer<T, IToken, INode, IThis> {
|
|
15
15
|
constructor(props?: ITokenizerProps);
|
|
16
16
|
readonly enableTaskListItem: boolean;
|
|
17
|
-
readonly emptyItemCouldNotInterruptedTypes: ReadonlyArray<
|
|
17
|
+
readonly emptyItemCouldNotInterruptedTypes: ReadonlyArray<NodeType>;
|
|
18
18
|
readonly match: IMatchBlockHookCreator<T, IToken, IThis>;
|
|
19
19
|
readonly parse: IParseBlockHookCreator<T, IToken, INode, IThis>;
|
|
20
20
|
}
|
package/lib/types/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { List, ListType, NodeType, TaskStatus } from '@yozora/ast';
|
|
2
2
|
import type { IBaseBlockTokenizerProps, IPartialYastBlockToken, ITokenizer, IYastBlockToken } from '@yozora/core-tokenizer';
|
|
3
3
|
export declare type T = ListType;
|
|
4
|
-
export declare type INode =
|
|
4
|
+
export declare type INode = List;
|
|
5
5
|
export declare const uniqueName = "@yozora/tokenizer-list";
|
|
6
6
|
export interface IToken extends IPartialYastBlockToken<T> {
|
|
7
7
|
/**
|
|
@@ -41,11 +41,11 @@ export interface IToken extends IPartialYastBlockToken<T> {
|
|
|
41
41
|
}
|
|
42
42
|
export interface IThis extends ITokenizer {
|
|
43
43
|
/**
|
|
44
|
-
* Specify an array of
|
|
44
|
+
* Specify an array of Node types that could not be interrupted
|
|
45
45
|
* by this ITokenizer if the current list-item is empty.
|
|
46
46
|
* @see https://github.github.com/gfm/#example-263
|
|
47
47
|
*/
|
|
48
|
-
readonly emptyItemCouldNotInterruptedTypes: ReadonlyArray<
|
|
48
|
+
readonly emptyItemCouldNotInterruptedTypes: ReadonlyArray<NodeType>;
|
|
49
49
|
/**
|
|
50
50
|
* Should enable task list item (extension).
|
|
51
51
|
*/
|
|
@@ -53,11 +53,11 @@ export interface IThis extends ITokenizer {
|
|
|
53
53
|
}
|
|
54
54
|
export interface ITokenizerProps extends Partial<IBaseBlockTokenizerProps> {
|
|
55
55
|
/**
|
|
56
|
-
* Specify an array of
|
|
56
|
+
* Specify an array of Node types that could not be interrupted
|
|
57
57
|
* by this ITokenizer if the current list-item is empty.
|
|
58
58
|
* @see https://github.github.com/gfm/#example-263
|
|
59
59
|
*/
|
|
60
|
-
readonly emptyItemCouldNotInterruptedTypes?:
|
|
60
|
+
readonly emptyItemCouldNotInterruptedTypes?: NodeType[];
|
|
61
61
|
/**
|
|
62
62
|
* Should enable task list item (extension).
|
|
63
63
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozora/tokenizer-list",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.3",
|
|
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.
|
|
39
|
-
"@yozora/character": "^2.0.0-alpha.
|
|
40
|
-
"@yozora/core-tokenizer": "^2.0.0-alpha.
|
|
38
|
+
"@yozora/ast": "^2.0.0-alpha.3",
|
|
39
|
+
"@yozora/character": "^2.0.0-alpha.3",
|
|
40
|
+
"@yozora/core-tokenizer": "^2.0.0-alpha.3"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "9f274fc7487a8c1dd213405d92508f9a7621f730"
|
|
43
43
|
}
|