@yozora/tokenizer-html-inline 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 +8 -8
- package/package.json +6 -6
- package/src/types.ts +3 -6
- package/src/util/cdata.ts +2 -2
- package/src/util/closing.ts +2 -4
- package/src/util/comment.ts +2 -4
- package/src/util/declaration.ts +2 -2
- package/src/util/instruction.ts +2 -2
- package/src/util/open.ts +2 -2
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { INodePoint, INodeInterval } from '@yozora/character';
|
|
2
|
-
import {
|
|
2
|
+
import { ITokenDelimiter, IPartialInlineToken, ITokenizer, IBaseInlineTokenizerProps, IMatchInlineHookCreator, IParseInlineHookCreator, BaseInlineTokenizer, IInlineTokenizer } from '@yozora/core-tokenizer';
|
|
3
3
|
import { RawHTMLAttribute } from '@yozora/tokenizer-html-block';
|
|
4
4
|
import { HtmlType, Html } from '@yozora/ast';
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ interface IHtmlInlineCDataData {
|
|
|
9
9
|
interface IHtmlInlineCDataTokenData {
|
|
10
10
|
htmlType: 'cdata';
|
|
11
11
|
}
|
|
12
|
-
interface IHtmlInlineCDataDelimiter extends
|
|
12
|
+
interface IHtmlInlineCDataDelimiter extends ITokenDelimiter, IHtmlInlineCDataTokenData {
|
|
13
13
|
type: 'full';
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
@@ -31,7 +31,7 @@ interface IHtmlInlineClosingTokenData {
|
|
|
31
31
|
htmlType: 'closing';
|
|
32
32
|
tagName: INodeInterval;
|
|
33
33
|
}
|
|
34
|
-
interface IHtmlInlineClosingDelimiter extends
|
|
34
|
+
interface IHtmlInlineClosingDelimiter extends ITokenDelimiter, IHtmlInlineClosingTokenData {
|
|
35
35
|
type: 'full';
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
@@ -51,7 +51,7 @@ interface IHtmlInlineCommentData {
|
|
|
51
51
|
interface IHtmlInlineCommentTokenData {
|
|
52
52
|
htmlType: 'comment';
|
|
53
53
|
}
|
|
54
|
-
interface IHtmlInlineCommentDelimiter extends
|
|
54
|
+
interface IHtmlInlineCommentDelimiter extends ITokenDelimiter, IHtmlInlineCommentTokenData {
|
|
55
55
|
type: 'full';
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
@@ -72,7 +72,7 @@ interface IHtmlInlineDeclarationTokenData {
|
|
|
72
72
|
htmlType: 'declaration';
|
|
73
73
|
tagName: INodeInterval;
|
|
74
74
|
}
|
|
75
|
-
interface IHtmlInlineDeclarationDelimiter extends
|
|
75
|
+
interface IHtmlInlineDeclarationDelimiter extends ITokenDelimiter, IHtmlInlineDeclarationTokenData {
|
|
76
76
|
type: 'full';
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
@@ -97,7 +97,7 @@ interface IHtmlInlineInstructionData {
|
|
|
97
97
|
interface IHtmlInlineInstructionTokenData {
|
|
98
98
|
htmlType: 'instruction';
|
|
99
99
|
}
|
|
100
|
-
interface IHtmlInlineInstructionDelimiter extends
|
|
100
|
+
interface IHtmlInlineInstructionDelimiter extends ITokenDelimiter, IHtmlInlineInstructionTokenData {
|
|
101
101
|
type: 'full';
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
@@ -135,7 +135,7 @@ interface IHtmlInlineOpenTokenData {
|
|
|
135
135
|
attributes: RawHTMLAttribute[];
|
|
136
136
|
selfClosed: boolean;
|
|
137
137
|
}
|
|
138
|
-
interface IHtmlInlineOpenDelimiter extends
|
|
138
|
+
interface IHtmlInlineOpenDelimiter extends ITokenDelimiter, IHtmlInlineOpenTokenData {
|
|
139
139
|
type: 'full';
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
@@ -160,7 +160,7 @@ declare const uniqueName = "@yozora/tokenizer-html-inline";
|
|
|
160
160
|
*
|
|
161
161
|
* @see https://github.github.com/gfm/#raw-html
|
|
162
162
|
*/
|
|
163
|
-
type IToken =
|
|
163
|
+
type IToken = IPartialInlineToken<T> & (IHtmlInlineOpenTokenData | IHtmlInlineClosingTokenData | IHtmlInlineCommentTokenData | IHtmlInlineInstructionTokenData | IHtmlInlineDeclarationTokenData | IHtmlInlineCDataTokenData);
|
|
164
164
|
type IDelimiter = IHtmlInlineOpenDelimiter | IHtmlInlineClosingDelimiter | IHtmlInlineCommentDelimiter | IHtmlInlineInstructionDelimiter | IHtmlInlineDeclarationDelimiter | IHtmlInlineCDataDelimiter;
|
|
165
165
|
type IThis = ITokenizer;
|
|
166
166
|
type ITokenizerProps = Partial<IBaseInlineTokenizerProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozora/tokenizer-html-inline",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
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.
|
|
43
|
-
"@yozora/character": "^2.
|
|
44
|
-
"@yozora/core-tokenizer": "^2.
|
|
45
|
-
"@yozora/tokenizer-html-block": "^2.
|
|
42
|
+
"@yozora/ast": "^2.1.1",
|
|
43
|
+
"@yozora/character": "^2.1.1",
|
|
44
|
+
"@yozora/core-tokenizer": "^2.1.1",
|
|
45
|
+
"@yozora/tokenizer-html-block": "^2.1.1"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "257a36d8dc079d4ac226405c155b238e7099bcea"
|
|
48
48
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Html, HtmlType } from '@yozora/ast'
|
|
2
2
|
import type {
|
|
3
3
|
IBaseInlineTokenizerProps,
|
|
4
|
-
|
|
4
|
+
IPartialInlineToken,
|
|
5
5
|
ITokenizer,
|
|
6
6
|
} from '@yozora/core-tokenizer'
|
|
7
7
|
import type { IHtmlInlineCDataDelimiter, IHtmlInlineCDataTokenData } from './util/cdata'
|
|
@@ -15,10 +15,7 @@ import type {
|
|
|
15
15
|
IHtmlInlineInstructionDelimiter,
|
|
16
16
|
IHtmlInlineInstructionTokenData,
|
|
17
17
|
} from './util/instruction'
|
|
18
|
-
import type {
|
|
19
|
-
IHtmlInlineOpenDelimiter,
|
|
20
|
-
IHtmlInlineOpenTokenData as IHtmlInlineOpenTokenData,
|
|
21
|
-
} from './util/open'
|
|
18
|
+
import type { IHtmlInlineOpenDelimiter, IHtmlInlineOpenTokenData } from './util/open'
|
|
22
19
|
|
|
23
20
|
export type T = HtmlType
|
|
24
21
|
export type INode = Html
|
|
@@ -32,7 +29,7 @@ export const uniqueName = '@yozora/tokenizer-html-inline'
|
|
|
32
29
|
*
|
|
33
30
|
* @see https://github.github.com/gfm/#raw-html
|
|
34
31
|
*/
|
|
35
|
-
export type IToken =
|
|
32
|
+
export type IToken = IPartialInlineToken<T> &
|
|
36
33
|
(
|
|
37
34
|
| IHtmlInlineOpenTokenData
|
|
38
35
|
| IHtmlInlineClosingTokenData
|
package/src/util/cdata.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { INodePoint } from '@yozora/character'
|
|
2
2
|
import { AsciiCodePoint } from '@yozora/character'
|
|
3
|
-
import type {
|
|
3
|
+
import type { ITokenDelimiter } from '@yozora/core-tokenizer'
|
|
4
4
|
|
|
5
5
|
export interface IHtmlInlineCDataData {
|
|
6
6
|
htmlType: 'cdata'
|
|
@@ -10,7 +10,7 @@ export interface IHtmlInlineCDataTokenData {
|
|
|
10
10
|
htmlType: 'cdata'
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export interface IHtmlInlineCDataDelimiter extends
|
|
13
|
+
export interface IHtmlInlineCDataDelimiter extends ITokenDelimiter, IHtmlInlineCDataTokenData {
|
|
14
14
|
type: 'full'
|
|
15
15
|
}
|
|
16
16
|
|
package/src/util/closing.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { INodeInterval, INodePoint } from '@yozora/character'
|
|
2
2
|
import { AsciiCodePoint } from '@yozora/character'
|
|
3
|
-
import type {
|
|
3
|
+
import type { ITokenDelimiter } from '@yozora/core-tokenizer'
|
|
4
4
|
import { eatOptionalWhitespaces } from '@yozora/core-tokenizer'
|
|
5
5
|
import { eatHTMLTagName } from '@yozora/tokenizer-html-block'
|
|
6
6
|
|
|
@@ -14,9 +14,7 @@ export interface IHtmlInlineClosingTokenData {
|
|
|
14
14
|
tagName: INodeInterval
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export interface IHtmlInlineClosingDelimiter
|
|
18
|
-
extends IYastTokenDelimiter,
|
|
19
|
-
IHtmlInlineClosingTokenData {
|
|
17
|
+
export interface IHtmlInlineClosingDelimiter extends ITokenDelimiter, IHtmlInlineClosingTokenData {
|
|
20
18
|
type: 'full'
|
|
21
19
|
}
|
|
22
20
|
|
package/src/util/comment.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { INodePoint } from '@yozora/character'
|
|
2
2
|
import { AsciiCodePoint } from '@yozora/character'
|
|
3
|
-
import type {
|
|
3
|
+
import type { ITokenDelimiter } from '@yozora/core-tokenizer'
|
|
4
4
|
|
|
5
5
|
export interface IHtmlInlineCommentData {
|
|
6
6
|
htmlType: 'comment'
|
|
@@ -10,9 +10,7 @@ export interface IHtmlInlineCommentTokenData {
|
|
|
10
10
|
htmlType: 'comment'
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export interface IHtmlInlineCommentDelimiter
|
|
14
|
-
extends IYastTokenDelimiter,
|
|
15
|
-
IHtmlInlineCommentTokenData {
|
|
13
|
+
export interface IHtmlInlineCommentDelimiter extends ITokenDelimiter, IHtmlInlineCommentTokenData {
|
|
16
14
|
type: 'full'
|
|
17
15
|
}
|
|
18
16
|
|
package/src/util/declaration.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { INodeInterval, INodePoint } from '@yozora/character'
|
|
2
2
|
import { AsciiCodePoint, isAsciiUpperLetter, isWhitespaceCharacter } from '@yozora/character'
|
|
3
|
-
import type {
|
|
3
|
+
import type { ITokenDelimiter } from '@yozora/core-tokenizer'
|
|
4
4
|
|
|
5
5
|
export interface IHtmlInlineDeclarationData {
|
|
6
6
|
htmlType: 'declaration'
|
|
@@ -12,7 +12,7 @@ export interface IHtmlInlineDeclarationTokenData {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export interface IHtmlInlineDeclarationDelimiter
|
|
15
|
-
extends
|
|
15
|
+
extends ITokenDelimiter,
|
|
16
16
|
IHtmlInlineDeclarationTokenData {
|
|
17
17
|
type: 'full'
|
|
18
18
|
}
|
package/src/util/instruction.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { INodePoint } from '@yozora/character'
|
|
2
2
|
import { AsciiCodePoint } from '@yozora/character'
|
|
3
|
-
import type {
|
|
3
|
+
import type { ITokenDelimiter } from '@yozora/core-tokenizer'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
@@ -15,7 +15,7 @@ export interface IHtmlInlineInstructionTokenData {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export interface IHtmlInlineInstructionDelimiter
|
|
18
|
-
extends
|
|
18
|
+
extends ITokenDelimiter,
|
|
19
19
|
IHtmlInlineInstructionTokenData {
|
|
20
20
|
type: 'full'
|
|
21
21
|
}
|
package/src/util/open.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { INodeInterval, INodePoint } from '@yozora/character'
|
|
2
2
|
import { AsciiCodePoint } from '@yozora/character'
|
|
3
|
-
import type {
|
|
3
|
+
import type { ITokenDelimiter } from '@yozora/core-tokenizer'
|
|
4
4
|
import { eatOptionalWhitespaces } from '@yozora/core-tokenizer'
|
|
5
5
|
import type { RawHTMLAttribute } from '@yozora/tokenizer-html-block'
|
|
6
6
|
import { eatHTMLAttribute, eatHTMLTagName } from '@yozora/tokenizer-html-block'
|
|
@@ -28,7 +28,7 @@ export interface IHtmlInlineOpenTokenData {
|
|
|
28
28
|
selfClosed: boolean
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export interface IHtmlInlineOpenDelimiter extends
|
|
31
|
+
export interface IHtmlInlineOpenDelimiter extends ITokenDelimiter, IHtmlInlineOpenTokenData {
|
|
32
32
|
type: 'full'
|
|
33
33
|
}
|
|
34
34
|
|