@yozora/tokenizer-blockquote 2.0.6 → 2.1.1
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 +3 -3
- package/src/types.ts +4 -4
package/lib/types/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IPartialBlockToken, IBlockToken, ITokenizer, IBaseBlockTokenizerProps, IMatchBlockHookCreator, IParseBlockHookCreator, BaseBlockTokenizer, IBlockTokenizer } from '@yozora/core-tokenizer';
|
|
2
2
|
import { BlockquoteType, Blockquote } from '@yozora/ast';
|
|
3
3
|
|
|
4
4
|
type T = BlockquoteType;
|
|
5
5
|
type INode = Blockquote;
|
|
6
6
|
declare const uniqueName = "@yozora/tokenizer-blockquote";
|
|
7
|
-
interface IToken extends
|
|
7
|
+
interface IToken extends IPartialBlockToken<T> {
|
|
8
8
|
/**
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
11
|
-
children:
|
|
11
|
+
children: IBlockToken[];
|
|
12
12
|
}
|
|
13
13
|
type IThis = ITokenizer;
|
|
14
14
|
type ITokenizerProps = Partial<IBaseBlockTokenizerProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozora/tokenizer-blockquote",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
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.
|
|
43
|
-
"@yozora/character": "^2.
|
|
44
|
-
"@yozora/core-tokenizer": "^2.
|
|
42
|
+
"@yozora/ast": "^2.1.1",
|
|
43
|
+
"@yozora/character": "^2.1.1",
|
|
44
|
+
"@yozora/core-tokenizer": "^2.1.1"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "257a36d8dc079d4ac226405c155b238e7099bcea"
|
|
47
47
|
}
|
package/src/match.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BlockquoteType } from '@yozora/ast'
|
|
2
2
|
import { AsciiCodePoint, VirtualCodePoint, isSpaceCharacter } from '@yozora/character'
|
|
3
3
|
import type {
|
|
4
|
+
IBlockToken,
|
|
4
5
|
IMatchBlockHookCreator,
|
|
5
6
|
IPhrasingContentLine,
|
|
6
7
|
IResultOfEatAndInterruptPreviousSibling,
|
|
7
8
|
IResultOfEatContinuationText,
|
|
8
9
|
IResultOfEatOpener,
|
|
9
|
-
IYastBlockToken,
|
|
10
10
|
} from '@yozora/core-tokenizer'
|
|
11
11
|
import { calcEndPoint, calcStartPoint } from '@yozora/core-tokenizer'
|
|
12
12
|
import type { IThis, IToken, T } from './types'
|
|
@@ -89,7 +89,7 @@ export const match: IMatchBlockHookCreator<T, IToken, IThis> = function () {
|
|
|
89
89
|
|
|
90
90
|
function eatAndInterruptPreviousSibling(
|
|
91
91
|
line: Readonly<IPhrasingContentLine>,
|
|
92
|
-
prevSiblingToken: Readonly<
|
|
92
|
+
prevSiblingToken: Readonly<IBlockToken>,
|
|
93
93
|
): IResultOfEatAndInterruptPreviousSibling<T, IToken> {
|
|
94
94
|
const result = eatOpener(line)
|
|
95
95
|
if (result == null) return null
|
|
@@ -103,7 +103,7 @@ export const match: IMatchBlockHookCreator<T, IToken, IThis> = function () {
|
|
|
103
103
|
function eatContinuationText(
|
|
104
104
|
line: Readonly<IPhrasingContentLine>,
|
|
105
105
|
token: IToken,
|
|
106
|
-
parentToken: Readonly<
|
|
106
|
+
parentToken: Readonly<IBlockToken>,
|
|
107
107
|
): IResultOfEatContinuationText {
|
|
108
108
|
const { nodePoints, startIndex, endIndex, firstNonWhitespaceIndex, countOfPrecedeSpaces } = line
|
|
109
109
|
|
package/src/types.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import type { Blockquote, BlockquoteType } 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 = BlockquoteType
|
|
10
10
|
export type INode = Blockquote
|
|
11
11
|
export const uniqueName = '@yozora/tokenizer-blockquote'
|
|
12
12
|
|
|
13
|
-
export interface IToken extends
|
|
13
|
+
export interface IToken extends IPartialBlockToken<T> {
|
|
14
14
|
/**
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
|
-
children:
|
|
17
|
+
children: IBlockToken[]
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export type IThis = ITokenizer
|