@yozora/tokenizer-html-block 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 +2 -2
- package/package.json +5 -5
- package/src/match.ts +2 -2
- package/src/types.ts +2 -2
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { INodeInterval, INodePoint } from '@yozora/character';
|
|
2
|
-
import {
|
|
2
|
+
import { IPartialBlockToken, IPhrasingContentLine, ITokenizer, IBaseBlockTokenizerProps, IMatchBlockHookCreator, IParseBlockHookCreator, BaseBlockTokenizer, IBlockTokenizer } from '@yozora/core-tokenizer';
|
|
3
3
|
import { HtmlType, Html } from '@yozora/ast';
|
|
4
4
|
|
|
5
5
|
interface RawHTMLAttribute {
|
|
@@ -44,7 +44,7 @@ type HtmlBlockConditionType = 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
|
44
44
|
/**
|
|
45
45
|
* Middle state during the whole match and parse phase.
|
|
46
46
|
*/
|
|
47
|
-
interface IToken extends
|
|
47
|
+
interface IToken extends IPartialBlockToken<T> {
|
|
48
48
|
/**
|
|
49
49
|
* Number of conditions defined in GFM:
|
|
50
50
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozora/tokenizer-html-block",
|
|
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
|
@@ -2,12 +2,12 @@ import { HtmlType } from '@yozora/ast'
|
|
|
2
2
|
import type { INodeInterval, INodePoint } from '@yozora/character'
|
|
3
3
|
import { AsciiCodePoint, calcStringFromNodePoints } from '@yozora/character'
|
|
4
4
|
import type {
|
|
5
|
+
IBlockToken,
|
|
5
6
|
IMatchBlockHookCreator,
|
|
6
7
|
IPhrasingContentLine,
|
|
7
8
|
IResultOfEatAndInterruptPreviousSibling,
|
|
8
9
|
IResultOfEatContinuationText,
|
|
9
10
|
IResultOfEatOpener,
|
|
10
|
-
IYastBlockToken,
|
|
11
11
|
} from '@yozora/core-tokenizer'
|
|
12
12
|
import { calcEndPoint, calcStartPoint, eatOptionalWhitespaces } from '@yozora/core-tokenizer'
|
|
13
13
|
import { eatEndCondition1, eatStartCondition1 } from './conditions/c1'
|
|
@@ -81,7 +81,7 @@ export const match: IMatchBlockHookCreator<T, IToken, IThis> = function () {
|
|
|
81
81
|
|
|
82
82
|
function eatAndInterruptPreviousSibling(
|
|
83
83
|
line: Readonly<IPhrasingContentLine>,
|
|
84
|
-
prevSiblingToken: Readonly<
|
|
84
|
+
prevSiblingToken: Readonly<IBlockToken>,
|
|
85
85
|
): IResultOfEatAndInterruptPreviousSibling<T, IToken> {
|
|
86
86
|
const result = eatOpener(line)
|
|
87
87
|
if (result == null || result.token.condition === 7) return null
|
package/src/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Html, HtmlType } from '@yozora/ast'
|
|
2
2
|
import type {
|
|
3
3
|
IBaseBlockTokenizerProps,
|
|
4
|
-
|
|
4
|
+
IPartialBlockToken,
|
|
5
5
|
IPhrasingContentLine,
|
|
6
6
|
ITokenizer,
|
|
7
7
|
} from '@yozora/core-tokenizer'
|
|
@@ -15,7 +15,7 @@ export type HtmlBlockConditionType = 1 | 2 | 3 | 4 | 5 | 6 | 7
|
|
|
15
15
|
/**
|
|
16
16
|
* Middle state during the whole match and parse phase.
|
|
17
17
|
*/
|
|
18
|
-
export interface IToken extends
|
|
18
|
+
export interface IToken extends IPartialBlockToken<T> {
|
|
19
19
|
/**
|
|
20
20
|
* Number of conditions defined in GFM:
|
|
21
21
|
*
|