@yozora/tokenizer-fenced-block 2.0.2 → 2.0.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/LICENSE +1 -1
- package/package.json +6 -6
- package/lib/types/match.d.ts +0 -4
- package/lib/types/tokenizer.d.ts +0 -23
- package/lib/types/types.d.ts +0 -73
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2020-
|
|
3
|
+
Copyright (c) 2020-2022 guanghechen (me.guanghechen@gmail.com)
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozora/tokenizer-fenced-block",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "guanghechen",
|
|
6
6
|
"url": "https://github.com/guanghechen/"
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
],
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "cross-env NODE_ENV=production rollup -c ../../rollup.config.js",
|
|
33
|
-
"prebuild": "rimraf lib/
|
|
33
|
+
"prebuild": "rimraf lib/",
|
|
34
34
|
"prepublishOnly": "cross-env ROLLUP_SHOULD_SOURCEMAP=false yarn build",
|
|
35
35
|
"test": "echo 'No test yet.'"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@yozora/ast": "^2.0.
|
|
39
|
-
"@yozora/character": "^2.0.
|
|
40
|
-
"@yozora/core-tokenizer": "^2.0.
|
|
38
|
+
"@yozora/ast": "^2.0.3",
|
|
39
|
+
"@yozora/character": "^2.0.3",
|
|
40
|
+
"@yozora/core-tokenizer": "^2.0.3"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "8cc8f95cfebc8d752bc3272cdd24965f540c130b"
|
|
43
43
|
}
|
package/lib/types/match.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { NodeType } from '@yozora/ast';
|
|
2
|
-
import type { IMatchBlockHook, IMatchBlockPhaseApi } from '@yozora/core-tokenizer';
|
|
3
|
-
import type { IFencedBlockHookContext, IToken } from './types';
|
|
4
|
-
export declare function match<T extends NodeType = NodeType, IThis extends IFencedBlockHookContext<T> = IFencedBlockHookContext<T>>(this: IThis, _api: IMatchBlockPhaseApi): IMatchBlockHook<T, IToken<T>>;
|
package/lib/types/tokenizer.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Node, NodeType } from '@yozora/ast';
|
|
2
|
-
import type { ICodePoint } from '@yozora/character';
|
|
3
|
-
import type { IBlockTokenizer, IMatchBlockHookCreator } from '@yozora/core-tokenizer';
|
|
4
|
-
import { BaseBlockTokenizer } from '@yozora/core-tokenizer';
|
|
5
|
-
import type { IFencedBlockHookContext, IToken, ITokenizerProps } from './types';
|
|
6
|
-
/**
|
|
7
|
-
* Lexical Matcher for FencedBlock.
|
|
8
|
-
*
|
|
9
|
-
* A block fence is a sequence of fence-marker characters (different marker
|
|
10
|
-
* cannot be mixed.) A fenced block begins with a block fence, indented no more
|
|
11
|
-
* than three spaces.
|
|
12
|
-
*
|
|
13
|
-
* @see https://github.com/syntax-tree/mdast#code
|
|
14
|
-
* @see https://github.github.com/gfm/#code-fence
|
|
15
|
-
*/
|
|
16
|
-
export declare abstract class FencedBlockTokenizer<T extends NodeType = NodeType, INode extends Node<T> = Node<T>, IThis extends IFencedBlockHookContext<T> = IFencedBlockHookContext<T>> extends BaseBlockTokenizer<T, IToken<T>, INode, any> implements IBlockTokenizer<T, IToken<T>, INode, IThis> {
|
|
17
|
-
protected readonly nodeType: T;
|
|
18
|
-
protected readonly markers: ICodePoint[];
|
|
19
|
-
protected readonly markersRequired: number;
|
|
20
|
-
protected readonly checkInfoString: ITokenizerProps<T>['checkInfoString'];
|
|
21
|
-
constructor(props: ITokenizerProps<T>);
|
|
22
|
-
readonly match: IMatchBlockHookCreator<T, IToken<T>, IThis>;
|
|
23
|
-
}
|
package/lib/types/types.d.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { NodeType } from '@yozora/ast';
|
|
2
|
-
import type { ICodePoint, INodePoint } from '@yozora/character';
|
|
3
|
-
import type { IBaseBlockTokenizerProps, IPartialYastBlockToken, IPhrasingContentLine, ITokenizer } from '@yozora/core-tokenizer';
|
|
4
|
-
export declare const FencedBlockType = "fencedBlock";
|
|
5
|
-
export declare type FencedBlockType = typeof FencedBlockType;
|
|
6
|
-
export interface IToken<T extends NodeType> extends IPartialYastBlockToken<T> {
|
|
7
|
-
/**
|
|
8
|
-
* Line indent of a fenced block.
|
|
9
|
-
*/
|
|
10
|
-
indent: number;
|
|
11
|
-
/**
|
|
12
|
-
* Fence marker.
|
|
13
|
-
*/
|
|
14
|
-
marker: number;
|
|
15
|
-
/**
|
|
16
|
-
* The number of fence marker.
|
|
17
|
-
*/
|
|
18
|
-
markerCount: number;
|
|
19
|
-
/**
|
|
20
|
-
* Lines to construct the contents of a paragraph.
|
|
21
|
-
*/
|
|
22
|
-
lines: IPhrasingContentLine[];
|
|
23
|
-
/**
|
|
24
|
-
* Meta info string
|
|
25
|
-
*/
|
|
26
|
-
infoString: INodePoint[];
|
|
27
|
-
}
|
|
28
|
-
export interface IFencedBlockHookContext<T extends NodeType> extends ITokenizer {
|
|
29
|
-
/**
|
|
30
|
-
* Type of special FencedBlock token and FencedBlock node.
|
|
31
|
-
*/
|
|
32
|
-
nodeType: T;
|
|
33
|
-
/**
|
|
34
|
-
* Available fence markers.
|
|
35
|
-
*/
|
|
36
|
-
markers: ICodePoint[];
|
|
37
|
-
/**
|
|
38
|
-
* The minimum amount required
|
|
39
|
-
*/
|
|
40
|
-
markersRequired: number;
|
|
41
|
-
/**
|
|
42
|
-
* Check if the info string is valid.
|
|
43
|
-
* @param infoString
|
|
44
|
-
* @param marker
|
|
45
|
-
* @param countOfMarker
|
|
46
|
-
*/
|
|
47
|
-
checkInfoString?(infoString: Readonly<INodePoint[]>, marker: ICodePoint, countOfMarker: number): boolean;
|
|
48
|
-
}
|
|
49
|
-
export interface ITokenizerProps<T extends NodeType> extends Partial<IBaseBlockTokenizerProps> {
|
|
50
|
-
/**
|
|
51
|
-
* ITokenizer name.
|
|
52
|
-
*/
|
|
53
|
-
name: string;
|
|
54
|
-
/**
|
|
55
|
-
* Type of special FencedBlock token and FencedBlock node.
|
|
56
|
-
*/
|
|
57
|
-
nodeType: T;
|
|
58
|
-
/**
|
|
59
|
-
* Available fence markers.
|
|
60
|
-
*/
|
|
61
|
-
markers: ICodePoint[];
|
|
62
|
-
/**
|
|
63
|
-
* The minimum amount required
|
|
64
|
-
*/
|
|
65
|
-
markersRequired: number;
|
|
66
|
-
/**
|
|
67
|
-
* Check if the info string is valid.
|
|
68
|
-
* @param infoString
|
|
69
|
-
* @param marker
|
|
70
|
-
* @param countOfMarker
|
|
71
|
-
*/
|
|
72
|
-
checkInfoString?(infoString: Readonly<INodePoint[]>, marker: ICodePoint, countOfMarker: number): boolean;
|
|
73
|
-
}
|