@yozora/tokenizer-blockquote 1.3.0 → 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 +4 -6
- package/lib/cjs/index.js +44 -28
- package/lib/esm/index.js +43 -29
- package/lib/types/index.d.ts +4 -4
- package/lib/types/match.d.ts +27 -0
- package/lib/types/parse.d.ts +3 -0
- package/lib/types/tokenizer.d.ts +6 -47
- package/lib/types/types.d.ts +6 -5
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -84,14 +84,14 @@ so you can use `YozoraParser` / `GfmExParser` / `GfmParser` directly.
|
|
|
84
84
|
registered in *YastParser* as a plugin-in before it can be used.
|
|
85
85
|
|
|
86
86
|
```typescript {4,9}
|
|
87
|
-
import {
|
|
87
|
+
import { DefaultParser } from '@yozora/core-parser'
|
|
88
88
|
import ParagraphTokenizer from '@yozora/tokenizer-paragraph'
|
|
89
89
|
import TextTokenizer from '@yozora/tokenizer-text'
|
|
90
90
|
import BlockquoteTokenizer from '@yozora/tokenizer-blockquote'
|
|
91
91
|
|
|
92
|
-
const parser = new
|
|
93
|
-
.
|
|
94
|
-
.
|
|
92
|
+
const parser = new DefaultParser()
|
|
93
|
+
.useFallbackTokenizer(new ParagraphTokenizer())
|
|
94
|
+
.useFallbackTokenizer(new TextTokenizer())
|
|
95
95
|
.useTokenizer(new BlockquoteTokenizer())
|
|
96
96
|
|
|
97
97
|
// parse source markdown content
|
|
@@ -233,7 +233,6 @@ Name | Type | Required | Default
|
|
|
233
233
|
[@yozora/tokenizer-link]: https://github.com/yozorajs/yozora/tree/main/tokenizers/link#readme
|
|
234
234
|
[@yozora/tokenizer-link-reference]: https://github.com/yozorajs/yozora/tree/main/tokenizers/link-reference#readme
|
|
235
235
|
[@yozora/tokenizer-list]: https://github.com/yozorajs/yozora/tree/main/tokenizers/list#readme
|
|
236
|
-
[@yozora/tokenizer-list-item]: https://github.com/yozorajs/yozora/tree/main/tokenizers/list-item#readme
|
|
237
236
|
[@yozora/tokenizer-math]: https://github.com/yozorajs/yozora/tree/main/tokenizers/math#readme
|
|
238
237
|
[@yozora/tokenizer-paragraph]: https://github.com/yozorajs/yozora/tree/main/tokenizers/paragraph#readme
|
|
239
238
|
[@yozora/tokenizer-setext-heading]: https://github.com/yozorajs/yozora/tree/main/tokenizers/setext-heading#readme
|
|
@@ -293,7 +292,6 @@ Name | Type | Required | Default
|
|
|
293
292
|
[doc-@yozora/tokenizer-definition]: https://yozora.guanghechen.com/docs/package/tokenizer-definition
|
|
294
293
|
[doc-@yozora/tokenizer-link-reference]: https://yozora.guanghechen.com/docs/package/tokenizer-link-reference
|
|
295
294
|
[doc-@yozora/tokenizer-list]: https://yozora.guanghechen.com/docs/package/tokenizer-list
|
|
296
|
-
[doc-@yozora/tokenizer-list-item]: https://yozora.guanghechen.com/docs/package/tokenizer-list-item
|
|
297
295
|
[doc-@yozora/tokenizer-math]: https://yozora.guanghechen.com/docs/package/tokenizer-math
|
|
298
296
|
[doc-@yozora/tokenizer-paragraph]: https://yozora.guanghechen.com/docs/package/tokenizer-paragraph
|
|
299
297
|
[doc-@yozora/tokenizer-setext-heading]: https://yozora.guanghechen.com/docs/package/tokenizer-setext-heading
|
package/lib/cjs/index.js
CHANGED
|
@@ -6,31 +6,24 @@ var ast = require('@yozora/ast');
|
|
|
6
6
|
var character = require('@yozora/character');
|
|
7
7
|
var coreTokenizer = require('@yozora/core-tokenizer');
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
});
|
|
18
|
-
this.isContainingBlock = true;
|
|
19
|
-
}
|
|
20
|
-
eatOpener(line) {
|
|
9
|
+
const match = function () {
|
|
10
|
+
return {
|
|
11
|
+
isContainingBlock: true,
|
|
12
|
+
eatOpener,
|
|
13
|
+
eatAndInterruptPreviousSibling,
|
|
14
|
+
eatContinuationText,
|
|
15
|
+
};
|
|
16
|
+
function eatOpener(line) {
|
|
21
17
|
if (line.countOfPrecedeSpaces >= 4)
|
|
22
18
|
return null;
|
|
23
19
|
const { nodePoints, startIndex, endIndex, firstNonWhitespaceIndex } = line;
|
|
24
20
|
if (firstNonWhitespaceIndex >= endIndex ||
|
|
25
|
-
nodePoints[firstNonWhitespaceIndex].codePoint !==
|
|
26
|
-
character.AsciiCodePoint.CLOSE_ANGLE)
|
|
21
|
+
nodePoints[firstNonWhitespaceIndex].codePoint !== character.AsciiCodePoint.CLOSE_ANGLE)
|
|
27
22
|
return null;
|
|
28
23
|
let nextIndex = firstNonWhitespaceIndex + 1;
|
|
29
|
-
if (nextIndex < endIndex &&
|
|
30
|
-
character.isSpaceCharacter(nodePoints[nextIndex].codePoint)) {
|
|
24
|
+
if (nextIndex < endIndex && character.isSpaceCharacter(nodePoints[nextIndex].codePoint)) {
|
|
31
25
|
nextIndex += 1;
|
|
32
|
-
if (nextIndex < endIndex &&
|
|
33
|
-
nodePoints[nextIndex].codePoint === character.VirtualCodePoint.SPACE) {
|
|
26
|
+
if (nextIndex < endIndex && nodePoints[nextIndex].codePoint === character.VirtualCodePoint.SPACE) {
|
|
34
27
|
nextIndex += 1;
|
|
35
28
|
}
|
|
36
29
|
}
|
|
@@ -44,8 +37,8 @@ class BlockquoteTokenizer extends coreTokenizer.BaseBlockTokenizer {
|
|
|
44
37
|
};
|
|
45
38
|
return { token, nextIndex };
|
|
46
39
|
}
|
|
47
|
-
eatAndInterruptPreviousSibling(line, prevSiblingToken) {
|
|
48
|
-
const result =
|
|
40
|
+
function eatAndInterruptPreviousSibling(line, prevSiblingToken) {
|
|
41
|
+
const result = eatOpener(line);
|
|
49
42
|
if (result == null)
|
|
50
43
|
return null;
|
|
51
44
|
return {
|
|
@@ -54,12 +47,11 @@ class BlockquoteTokenizer extends coreTokenizer.BaseBlockTokenizer {
|
|
|
54
47
|
remainingSibling: prevSiblingToken,
|
|
55
48
|
};
|
|
56
49
|
}
|
|
57
|
-
eatContinuationText(line, token, parentToken) {
|
|
58
|
-
const { nodePoints, startIndex, endIndex, firstNonWhitespaceIndex, countOfPrecedeSpaces
|
|
50
|
+
function eatContinuationText(line, token, parentToken) {
|
|
51
|
+
const { nodePoints, startIndex, endIndex, firstNonWhitespaceIndex, countOfPrecedeSpaces } = line;
|
|
59
52
|
if (countOfPrecedeSpaces >= 4 ||
|
|
60
53
|
firstNonWhitespaceIndex >= endIndex ||
|
|
61
|
-
nodePoints[firstNonWhitespaceIndex].codePoint !==
|
|
62
|
-
character.AsciiCodePoint.CLOSE_ANGLE) {
|
|
54
|
+
nodePoints[firstNonWhitespaceIndex].codePoint !== character.AsciiCodePoint.CLOSE_ANGLE) {
|
|
63
55
|
if (parentToken.nodeType === ast.BlockquoteType) {
|
|
64
56
|
return { status: 'opening', nextIndex: startIndex };
|
|
65
57
|
}
|
|
@@ -71,12 +63,36 @@ class BlockquoteTokenizer extends coreTokenizer.BaseBlockTokenizer {
|
|
|
71
63
|
: firstNonWhitespaceIndex + 1;
|
|
72
64
|
return { status: 'opening', nextIndex };
|
|
73
65
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const parse = function (api) {
|
|
69
|
+
return {
|
|
70
|
+
parse: tokens => tokens.map(token => {
|
|
71
|
+
const children = api.parseBlockTokens(token.children);
|
|
72
|
+
const node = api.shouldReservePosition
|
|
73
|
+
? { type: ast.BlockquoteType, position: token.position, children }
|
|
74
|
+
: { type: ast.BlockquoteType, children };
|
|
75
|
+
return node;
|
|
76
|
+
}),
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const uniqueName = '@yozora/tokenizer-blockquote';
|
|
81
|
+
|
|
82
|
+
class BlockquoteTokenizer extends coreTokenizer.BaseBlockTokenizer {
|
|
83
|
+
constructor(props = {}) {
|
|
84
|
+
var _a, _b;
|
|
85
|
+
super({
|
|
86
|
+
name: (_a = props.name) !== null && _a !== void 0 ? _a : uniqueName,
|
|
87
|
+
priority: (_b = props.priority) !== null && _b !== void 0 ? _b : coreTokenizer.TokenizerPriority.CONTAINING_BLOCK,
|
|
88
|
+
});
|
|
89
|
+
this.match = match;
|
|
90
|
+
this.parse = parse;
|
|
77
91
|
}
|
|
78
92
|
}
|
|
79
93
|
|
|
80
94
|
exports.BlockquoteTokenizer = BlockquoteTokenizer;
|
|
81
95
|
exports.BlockquoteTokenizerName = uniqueName;
|
|
82
|
-
exports
|
|
96
|
+
exports.blockquoteMatch = match;
|
|
97
|
+
exports.blockquoteParse = parse;
|
|
98
|
+
exports["default"] = BlockquoteTokenizer;
|
package/lib/esm/index.js
CHANGED
|
@@ -1,32 +1,25 @@
|
|
|
1
1
|
import { BlockquoteType } from '@yozora/ast';
|
|
2
2
|
import { AsciiCodePoint, isSpaceCharacter, VirtualCodePoint } from '@yozora/character';
|
|
3
|
-
import {
|
|
3
|
+
import { calcStartYastNodePoint, calcEndYastNodePoint, BaseBlockTokenizer, TokenizerPriority } from '@yozora/core-tokenizer';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
14
|
-
this.isContainingBlock = true;
|
|
15
|
-
}
|
|
16
|
-
eatOpener(line) {
|
|
5
|
+
const match = function () {
|
|
6
|
+
return {
|
|
7
|
+
isContainingBlock: true,
|
|
8
|
+
eatOpener,
|
|
9
|
+
eatAndInterruptPreviousSibling,
|
|
10
|
+
eatContinuationText,
|
|
11
|
+
};
|
|
12
|
+
function eatOpener(line) {
|
|
17
13
|
if (line.countOfPrecedeSpaces >= 4)
|
|
18
14
|
return null;
|
|
19
15
|
const { nodePoints, startIndex, endIndex, firstNonWhitespaceIndex } = line;
|
|
20
16
|
if (firstNonWhitespaceIndex >= endIndex ||
|
|
21
|
-
nodePoints[firstNonWhitespaceIndex].codePoint !==
|
|
22
|
-
AsciiCodePoint.CLOSE_ANGLE)
|
|
17
|
+
nodePoints[firstNonWhitespaceIndex].codePoint !== AsciiCodePoint.CLOSE_ANGLE)
|
|
23
18
|
return null;
|
|
24
19
|
let nextIndex = firstNonWhitespaceIndex + 1;
|
|
25
|
-
if (nextIndex < endIndex &&
|
|
26
|
-
isSpaceCharacter(nodePoints[nextIndex].codePoint)) {
|
|
20
|
+
if (nextIndex < endIndex && isSpaceCharacter(nodePoints[nextIndex].codePoint)) {
|
|
27
21
|
nextIndex += 1;
|
|
28
|
-
if (nextIndex < endIndex &&
|
|
29
|
-
nodePoints[nextIndex].codePoint === VirtualCodePoint.SPACE) {
|
|
22
|
+
if (nextIndex < endIndex && nodePoints[nextIndex].codePoint === VirtualCodePoint.SPACE) {
|
|
30
23
|
nextIndex += 1;
|
|
31
24
|
}
|
|
32
25
|
}
|
|
@@ -40,8 +33,8 @@ class BlockquoteTokenizer extends BaseBlockTokenizer {
|
|
|
40
33
|
};
|
|
41
34
|
return { token, nextIndex };
|
|
42
35
|
}
|
|
43
|
-
eatAndInterruptPreviousSibling(line, prevSiblingToken) {
|
|
44
|
-
const result =
|
|
36
|
+
function eatAndInterruptPreviousSibling(line, prevSiblingToken) {
|
|
37
|
+
const result = eatOpener(line);
|
|
45
38
|
if (result == null)
|
|
46
39
|
return null;
|
|
47
40
|
return {
|
|
@@ -50,12 +43,11 @@ class BlockquoteTokenizer extends BaseBlockTokenizer {
|
|
|
50
43
|
remainingSibling: prevSiblingToken,
|
|
51
44
|
};
|
|
52
45
|
}
|
|
53
|
-
eatContinuationText(line, token, parentToken) {
|
|
54
|
-
const { nodePoints, startIndex, endIndex, firstNonWhitespaceIndex, countOfPrecedeSpaces
|
|
46
|
+
function eatContinuationText(line, token, parentToken) {
|
|
47
|
+
const { nodePoints, startIndex, endIndex, firstNonWhitespaceIndex, countOfPrecedeSpaces } = line;
|
|
55
48
|
if (countOfPrecedeSpaces >= 4 ||
|
|
56
49
|
firstNonWhitespaceIndex >= endIndex ||
|
|
57
|
-
nodePoints[firstNonWhitespaceIndex].codePoint !==
|
|
58
|
-
AsciiCodePoint.CLOSE_ANGLE) {
|
|
50
|
+
nodePoints[firstNonWhitespaceIndex].codePoint !== AsciiCodePoint.CLOSE_ANGLE) {
|
|
59
51
|
if (parentToken.nodeType === BlockquoteType) {
|
|
60
52
|
return { status: 'opening', nextIndex: startIndex };
|
|
61
53
|
}
|
|
@@ -67,10 +59,32 @@ class BlockquoteTokenizer extends BaseBlockTokenizer {
|
|
|
67
59
|
: firstNonWhitespaceIndex + 1;
|
|
68
60
|
return { status: 'opening', nextIndex };
|
|
69
61
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const parse = function (api) {
|
|
65
|
+
return {
|
|
66
|
+
parse: tokens => tokens.map(token => {
|
|
67
|
+
const children = api.parseBlockTokens(token.children);
|
|
68
|
+
const node = api.shouldReservePosition
|
|
69
|
+
? { type: BlockquoteType, position: token.position, children }
|
|
70
|
+
: { type: BlockquoteType, children };
|
|
71
|
+
return node;
|
|
72
|
+
}),
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const uniqueName = '@yozora/tokenizer-blockquote';
|
|
77
|
+
|
|
78
|
+
class BlockquoteTokenizer extends BaseBlockTokenizer {
|
|
79
|
+
constructor(props = {}) {
|
|
80
|
+
var _a, _b;
|
|
81
|
+
super({
|
|
82
|
+
name: (_a = props.name) !== null && _a !== void 0 ? _a : uniqueName,
|
|
83
|
+
priority: (_b = props.priority) !== null && _b !== void 0 ? _b : TokenizerPriority.CONTAINING_BLOCK,
|
|
84
|
+
});
|
|
85
|
+
this.match = match;
|
|
86
|
+
this.parse = parse;
|
|
73
87
|
}
|
|
74
88
|
}
|
|
75
89
|
|
|
76
|
-
export { BlockquoteTokenizer, uniqueName as BlockquoteTokenizerName, BlockquoteTokenizer as default };
|
|
90
|
+
export { BlockquoteTokenizer, uniqueName as BlockquoteTokenizerName, match as blockquoteMatch, parse as blockquoteParse, BlockquoteTokenizer as default };
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
1
|
+
export { match as blockquoteMatch } from './match';
|
|
2
|
+
export { parse as blockquoteParse } from './parse';
|
|
3
|
+
export { BlockquoteTokenizer, BlockquoteTokenizer as default } from './tokenizer';
|
|
3
4
|
export { uniqueName as BlockquoteTokenizerName } from './types';
|
|
4
|
-
export type {
|
|
5
|
-
export default BlockquoteTokenizer;
|
|
5
|
+
export type { IThis as IBlockquoteHookContext, IToken as IBlockquoteToken, ITokenizerProps as IBlockquoteTokenizerProps, } from './types';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { IMatchBlockHookCreator } from '@yozora/core-tokenizer';
|
|
2
|
+
import type { IThis, IToken, T } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A block quote marker consists of 0-3 spaces of initial indent, plus
|
|
5
|
+
* (a) the character > together with a following space, or
|
|
6
|
+
* (b) a single character > not followed by a space.
|
|
7
|
+
*
|
|
8
|
+
* The following rules define block quotes:
|
|
9
|
+
* - Basic case. If a string of lines Ls constitute a sequence of blocks Bs,
|
|
10
|
+
* then the result of prepending a block quote marker to the beginning of
|
|
11
|
+
* each line in Ls is a block quote containing Bs.
|
|
12
|
+
*
|
|
13
|
+
* - Laziness. If a string of lines Ls constitute a block quote with contents
|
|
14
|
+
* Bs, then the result of deleting the initial block quote marker from one
|
|
15
|
+
* or more lines in which the next non-whitespace character after the block
|
|
16
|
+
* quote marker is paragraph continuation text is a block quote with Bs as
|
|
17
|
+
* its content. Paragraph continuation text is text that will be parsed as
|
|
18
|
+
* part of the content of a paragraph, but does not occur at the beginning
|
|
19
|
+
* of the paragraph.
|
|
20
|
+
*
|
|
21
|
+
* - Consecutiveness. A document cannot contain two block quotes in a row
|
|
22
|
+
* unless there is a blank line between them.
|
|
23
|
+
*
|
|
24
|
+
* @see https://github.com/syntax-tree/mdast#blockquote
|
|
25
|
+
* @see https://github.github.com/gfm/#block-quotes
|
|
26
|
+
*/
|
|
27
|
+
export declare const match: IMatchBlockHookCreator<T, IToken, IThis>;
|
package/lib/types/tokenizer.d.ts
CHANGED
|
@@ -1,54 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { PhrasingContentLine, ResultOfEatAndInterruptPreviousSibling, ResultOfEatContinuationText, ResultOfEatOpener, ResultOfParse, Tokenizer, TokenizerMatchBlockHook, TokenizerParseBlockHook, YastBlockToken } from '@yozora/core-tokenizer';
|
|
1
|
+
import type { IBlockTokenizer, IMatchBlockHookCreator, IParseBlockHookCreator } from '@yozora/core-tokenizer';
|
|
3
2
|
import { BaseBlockTokenizer } from '@yozora/core-tokenizer';
|
|
4
|
-
import type {
|
|
3
|
+
import type { INode, IThis, IToken, ITokenizerProps, T } from './types';
|
|
5
4
|
/**
|
|
6
5
|
* Lexical Analyzer for Blockquote.
|
|
7
|
-
*
|
|
8
|
-
* A block quote marker consists of 0-3 spaces of initial indent, plus
|
|
9
|
-
* (a) the character > together with a following space, or
|
|
10
|
-
* (b) a single character > not followed by a space.
|
|
11
|
-
*
|
|
12
|
-
* The following rules define block quotes:
|
|
13
|
-
* - Basic case. If a string of lines Ls constitute a sequence of blocks Bs,
|
|
14
|
-
* then the result of prepending a block quote marker to the beginning of
|
|
15
|
-
* each line in Ls is a block quote containing Bs.
|
|
16
|
-
*
|
|
17
|
-
* - Laziness. If a string of lines Ls constitute a block quote with contents
|
|
18
|
-
* Bs, then the result of deleting the initial block quote marker from one
|
|
19
|
-
* or more lines in which the next non-whitespace character after the block
|
|
20
|
-
* quote marker is paragraph continuation text is a block quote with Bs as
|
|
21
|
-
* its content. Paragraph continuation text is text that will be parsed as
|
|
22
|
-
* part of the content of a paragraph, but does not occur at the beginning
|
|
23
|
-
* of the paragraph.
|
|
24
|
-
*
|
|
25
|
-
* - Consecutiveness. A document cannot contain two block quotes in a row
|
|
26
|
-
* unless there is a blank line between them.
|
|
27
|
-
*
|
|
28
6
|
* @see https://github.com/syntax-tree/mdast#blockquote
|
|
29
7
|
* @see https://github.github.com/gfm/#block-quotes
|
|
30
8
|
*/
|
|
31
|
-
export declare class BlockquoteTokenizer extends BaseBlockTokenizer
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
* @override
|
|
36
|
-
* @see TokenizerMatchBlockHook
|
|
37
|
-
*/
|
|
38
|
-
eatOpener(line: Readonly<PhrasingContentLine>): ResultOfEatOpener<T, Token>;
|
|
39
|
-
/**
|
|
40
|
-
* @override
|
|
41
|
-
* @see TokenizerMatchBlockHook
|
|
42
|
-
*/
|
|
43
|
-
eatAndInterruptPreviousSibling(line: Readonly<PhrasingContentLine>, prevSiblingToken: Readonly<YastBlockToken>): ResultOfEatAndInterruptPreviousSibling<T, Token>;
|
|
44
|
-
/**
|
|
45
|
-
* @override
|
|
46
|
-
* @see TokenizerMatchBlockHook
|
|
47
|
-
*/
|
|
48
|
-
eatContinuationText(line: Readonly<PhrasingContentLine>, token: Token, parentToken: Readonly<YastBlockToken>): ResultOfEatContinuationText;
|
|
49
|
-
/**
|
|
50
|
-
* @override
|
|
51
|
-
* @see TokenizerParseBlockHook
|
|
52
|
-
*/
|
|
53
|
-
parseBlock(token: Readonly<Token>, children: YastNode[]): ResultOfParse<T, Node>;
|
|
9
|
+
export declare class BlockquoteTokenizer extends BaseBlockTokenizer<T, IToken, INode, IThis> implements IBlockTokenizer<T, IToken, INode, IThis> {
|
|
10
|
+
constructor(props?: ITokenizerProps);
|
|
11
|
+
readonly match: IMatchBlockHookCreator<T, IToken, IThis>;
|
|
12
|
+
readonly parse: IParseBlockHookCreator<T, IToken, INode, IThis>;
|
|
54
13
|
}
|
package/lib/types/types.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { Blockquote, BlockquoteType } from '@yozora/ast';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IBaseBlockTokenizerProps, IPartialYastBlockToken, ITokenizer, IYastBlockToken } from '@yozora/core-tokenizer';
|
|
3
3
|
export declare type T = BlockquoteType;
|
|
4
|
-
export declare type
|
|
4
|
+
export declare type INode = Blockquote;
|
|
5
5
|
export declare const uniqueName = "@yozora/tokenizer-blockquote";
|
|
6
|
-
export interface
|
|
6
|
+
export interface IToken extends IPartialYastBlockToken<T> {
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
children:
|
|
10
|
+
children: IYastBlockToken[];
|
|
11
11
|
}
|
|
12
|
-
export declare type
|
|
12
|
+
export declare type IThis = ITokenizer;
|
|
13
|
+
export declare type ITokenizerProps = Partial<IBaseBlockTokenizerProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozora/tokenizer-blockquote",
|
|
3
|
-
"version": "
|
|
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": "^
|
|
39
|
-
"@yozora/character": "^
|
|
40
|
-
"@yozora/core-tokenizer": "^
|
|
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
|
}
|