@yozora/tokenizer-image 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 +6 -6
- package/src/match.ts +3 -3
- package/src/types.ts +4 -4
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node, ImageType, Image } from '@yozora/ast';
|
|
2
|
-
import {
|
|
2
|
+
import { IPartialInlineToken, ITokenizer, IBaseInlineTokenizerProps, ITokenDelimiter, IMatchInlineHookCreator, IParseInlineHookCreator, BaseInlineTokenizer, IInlineTokenizer } from '@yozora/core-tokenizer';
|
|
3
3
|
import { INodeInterval } from '@yozora/character';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -16,7 +16,7 @@ declare const uniqueName = "@yozora/tokenizer-image";
|
|
|
16
16
|
/**
|
|
17
17
|
* An image token.
|
|
18
18
|
*/
|
|
19
|
-
interface IToken extends
|
|
19
|
+
interface IToken extends IPartialInlineToken<T> {
|
|
20
20
|
/**
|
|
21
21
|
* Link destination interval.
|
|
22
22
|
*/
|
|
@@ -26,7 +26,7 @@ interface IToken extends IPartialYastInlineToken<T> {
|
|
|
26
26
|
*/
|
|
27
27
|
titleContent?: INodeInterval;
|
|
28
28
|
}
|
|
29
|
-
interface IDelimiter extends
|
|
29
|
+
interface IDelimiter extends ITokenDelimiter {
|
|
30
30
|
/**
|
|
31
31
|
* IDelimiter type.
|
|
32
32
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozora/tokenizer-image",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "guanghechen",
|
|
6
6
|
"url": "https://github.com/guanghechen/"
|
|
@@ -39,10 +39,10 @@
|
|
|
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
|
|
45
|
-
"@yozora/tokenizer-link": "^2.0
|
|
42
|
+
"@yozora/ast": "^2.1.0",
|
|
43
|
+
"@yozora/character": "^2.1.0",
|
|
44
|
+
"@yozora/core-tokenizer": "^2.1.0",
|
|
45
|
+
"@yozora/tokenizer-link": "^2.1.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "387a68e8f9154944e2a6a7009a808d076d0659c6"
|
|
48
48
|
}
|
package/src/match.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { ImageType } from '@yozora/ast'
|
|
|
2
2
|
import type { INodePoint } from '@yozora/character'
|
|
3
3
|
import { AsciiCodePoint } from '@yozora/character'
|
|
4
4
|
import type {
|
|
5
|
+
IInlineToken,
|
|
5
6
|
IMatchInlineHookCreator,
|
|
6
7
|
IResultOfIsDelimiterPair,
|
|
7
8
|
IResultOfProcessDelimiterPair,
|
|
8
|
-
IYastInlineToken,
|
|
9
9
|
} from '@yozora/core-tokenizer'
|
|
10
10
|
import { eatOptionalWhitespaces, genFindDelimiter } from '@yozora/core-tokenizer'
|
|
11
11
|
import {
|
|
@@ -170,7 +170,7 @@ export const match: IMatchInlineHookCreator<T, IDelimiter, IToken, IThis> = func
|
|
|
170
170
|
function isDelimiterPair(
|
|
171
171
|
openerDelimiter: IDelimiter,
|
|
172
172
|
closerDelimiter: IDelimiter,
|
|
173
|
-
internalTokens: ReadonlyArray<
|
|
173
|
+
internalTokens: ReadonlyArray<IInlineToken>,
|
|
174
174
|
): IResultOfIsDelimiterPair {
|
|
175
175
|
const nodePoints: ReadonlyArray<INodePoint> = api.getNodePoints()
|
|
176
176
|
const balancedBracketsStatus: -1 | 0 | 1 = checkBalancedBracketsStatus(
|
|
@@ -192,7 +192,7 @@ export const match: IMatchInlineHookCreator<T, IDelimiter, IToken, IThis> = func
|
|
|
192
192
|
function processDelimiterPair(
|
|
193
193
|
openerDelimiter: IDelimiter,
|
|
194
194
|
closerDelimiter: IDelimiter,
|
|
195
|
-
internalTokens: ReadonlyArray<
|
|
195
|
+
internalTokens: ReadonlyArray<IInlineToken>,
|
|
196
196
|
): IResultOfProcessDelimiterPair<T, IToken, IDelimiter> {
|
|
197
197
|
const token: IToken = {
|
|
198
198
|
nodeType: ImageType,
|
package/src/types.ts
CHANGED
|
@@ -2,9 +2,9 @@ import type { Image, ImageType } from '@yozora/ast'
|
|
|
2
2
|
import type { INodeInterval } from '@yozora/character'
|
|
3
3
|
import type {
|
|
4
4
|
IBaseInlineTokenizerProps,
|
|
5
|
-
|
|
5
|
+
IPartialInlineToken,
|
|
6
|
+
ITokenDelimiter,
|
|
6
7
|
ITokenizer,
|
|
7
|
-
IYastTokenDelimiter,
|
|
8
8
|
} from '@yozora/core-tokenizer'
|
|
9
9
|
|
|
10
10
|
export type T = ImageType
|
|
@@ -14,7 +14,7 @@ export const uniqueName = '@yozora/tokenizer-image'
|
|
|
14
14
|
/**
|
|
15
15
|
* An image token.
|
|
16
16
|
*/
|
|
17
|
-
export interface IToken extends
|
|
17
|
+
export interface IToken extends IPartialInlineToken<T> {
|
|
18
18
|
/**
|
|
19
19
|
* Link destination interval.
|
|
20
20
|
*/
|
|
@@ -25,7 +25,7 @@ export interface IToken extends IPartialYastInlineToken<T> {
|
|
|
25
25
|
titleContent?: INodeInterval
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export interface IDelimiter extends
|
|
28
|
+
export interface IDelimiter extends ITokenDelimiter {
|
|
29
29
|
/**
|
|
30
30
|
* IDelimiter type.
|
|
31
31
|
*/
|