@yozora/tokenizer-footnote-definition 2.0.1 → 2.0.2
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/README.md +45 -45
- package/lib/types/index.d.ts +89 -6
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<header>
|
|
4
4
|
<h1 align="center">
|
|
5
|
-
<a href="https://github.com/yozorajs/yozora/tree/
|
|
5
|
+
<a href="https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/footnote-definition#readme">@yozora/tokenizer-footnote-definition</a>
|
|
6
6
|
</h1>
|
|
7
7
|
<div align="center">
|
|
8
8
|
<a href="https://www.npmjs.com/package/@yozora/tokenizer-footnote-definition">
|
|
@@ -237,53 +237,53 @@ Name | Type | Required | Default
|
|
|
237
237
|
|
|
238
238
|
[live-examples]: https://yozora.guanghechen.com/docs/package/tokenizer-footnote-definition#live-examples
|
|
239
239
|
[docpage]: https://yozora.guanghechen.com/docs/package/tokenizer-footnote-definition
|
|
240
|
-
[homepage]: https://github.com/yozorajs/yozora/tree/
|
|
240
|
+
[homepage]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/footnote-definition#readme
|
|
241
241
|
[gfm-spec]: https://github.github.com/gfm
|
|
242
242
|
[mdast-homepage]: https://github.com/syntax-tree/mdast
|
|
243
243
|
|
|
244
|
-
[@yozora/ast]: https://github.com/yozorajs/yozora/tree/
|
|
245
|
-
[@yozora/ast-util]: https://github.com/yozorajs/yozora/tree/
|
|
246
|
-
[@yozora/character]: https://github.com/yozorajs/yozora/tree/
|
|
247
|
-
[@yozora/eslint-config]: https://github.com/yozorajs/yozora/tree/
|
|
248
|
-
[@yozora/core-parser]: https://github.com/yozorajs/yozora/tree/
|
|
249
|
-
[@yozora/core-tokenizer]: https://github.com/yozorajs/yozora/tree/
|
|
250
|
-
[@yozora/invariant]: https://github.com/yozorajs/yozora/tree/
|
|
251
|
-
[@yozora/jest-for-tokenizer]: https://github.com/yozorajs/yozora/tree/
|
|
252
|
-
[@yozora/parser]: https://github.com/yozorajs/yozora/tree/
|
|
253
|
-
[@yozora/parser-gfm]: https://github.com/yozorajs/yozora/tree/
|
|
254
|
-
[@yozora/parser-gfm-ex]: https://github.com/yozorajs/yozora/tree/
|
|
255
|
-
[@yozora/template-tokenizer]: https://github.com/yozorajs/yozora/tree/
|
|
256
|
-
[@yozora/tokenizer-admonition]: https://github.com/yozorajs/yozora/tree/
|
|
257
|
-
[@yozora/tokenizer-autolink]: https://github.com/yozorajs/yozora/tree/
|
|
258
|
-
[@yozora/tokenizer-autolink-extension]: https://github.com/yozorajs/yozora/tree/
|
|
259
|
-
[@yozora/tokenizer-blockquote]: https://github.com/yozorajs/yozora/tree/
|
|
260
|
-
[@yozora/tokenizer-break]: https://github.com/yozorajs/yozora/tree/
|
|
261
|
-
[@yozora/tokenizer-definition]: https://github.com/yozorajs/yozora/tree/
|
|
262
|
-
[@yozora/tokenizer-delete]: https://github.com/yozorajs/yozora/tree/
|
|
263
|
-
[@yozora/tokenizer-ecma-import]: https://github.com/yozorajs/yozora/tree/
|
|
264
|
-
[@yozora/tokenizer-emphasis]: https://github.com/yozorajs/yozora/tree/
|
|
265
|
-
[@yozora/tokenizer-fenced-block]: https://github.com/yozorajs/yozora/tree/
|
|
266
|
-
[@yozora/tokenizer-fenced-code]: https://github.com/yozorajs/yozora/tree/
|
|
267
|
-
[@yozora/tokenizer-footnote]: https://github.com/yozorajs/yozora/tree/
|
|
268
|
-
[@yozora/tokenizer-footnote-definition]: https://github.com/yozorajs/yozora/tree/
|
|
269
|
-
[@yozora/tokenizer-footnote-reference]: https://github.com/yozorajs/yozora/tree/
|
|
270
|
-
[@yozora/tokenizer-heading]: https://github.com/yozorajs/yozora/tree/
|
|
271
|
-
[@yozora/tokenizer-html-block]: https://github.com/yozorajs/yozora/tree/
|
|
272
|
-
[@yozora/tokenizer-html-inline]: https://github.com/yozorajs/yozora/tree/
|
|
273
|
-
[@yozora/tokenizer-image]: https://github.com/yozorajs/yozora/tree/
|
|
274
|
-
[@yozora/tokenizer-image-reference]: https://github.com/yozorajs/yozora/tree/
|
|
275
|
-
[@yozora/tokenizer-indented-code]: https://github.com/yozorajs/yozora/tree/
|
|
276
|
-
[@yozora/tokenizer-inline-code]: https://github.com/yozorajs/yozora/tree/
|
|
277
|
-
[@yozora/tokenizer-inline-math]: https://github.com/yozorajs/yozora/tree/
|
|
278
|
-
[@yozora/tokenizer-link]: https://github.com/yozorajs/yozora/tree/
|
|
279
|
-
[@yozora/tokenizer-link-reference]: https://github.com/yozorajs/yozora/tree/
|
|
280
|
-
[@yozora/tokenizer-list]: https://github.com/yozorajs/yozora/tree/
|
|
281
|
-
[@yozora/tokenizer-math]: https://github.com/yozorajs/yozora/tree/
|
|
282
|
-
[@yozora/tokenizer-paragraph]: https://github.com/yozorajs/yozora/tree/
|
|
283
|
-
[@yozora/tokenizer-setext-heading]: https://github.com/yozorajs/yozora/tree/
|
|
284
|
-
[@yozora/tokenizer-table]: https://github.com/yozorajs/yozora/tree/
|
|
285
|
-
[@yozora/tokenizer-text]: https://github.com/yozorajs/yozora/tree/
|
|
286
|
-
[@yozora/tokenizer-thematic-break]: https://github.com/yozorajs/yozora/tree/
|
|
244
|
+
[@yozora/ast]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/ast#readme
|
|
245
|
+
[@yozora/ast-util]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/ast-util#readme
|
|
246
|
+
[@yozora/character]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/character#readme
|
|
247
|
+
[@yozora/eslint-config]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/eslint-config#readme
|
|
248
|
+
[@yozora/core-parser]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/core-parser#readme
|
|
249
|
+
[@yozora/core-tokenizer]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/core-tokenizer#readme
|
|
250
|
+
[@yozora/invariant]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/invariant#readme
|
|
251
|
+
[@yozora/jest-for-tokenizer]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/jest-for-tokenizer#readme
|
|
252
|
+
[@yozora/parser]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/parser#readme
|
|
253
|
+
[@yozora/parser-gfm]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/parser-gfm#readme
|
|
254
|
+
[@yozora/parser-gfm-ex]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/parser-gfm-ex#readme
|
|
255
|
+
[@yozora/template-tokenizer]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/template-tokenizer#readme
|
|
256
|
+
[@yozora/tokenizer-admonition]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/admonition#readme
|
|
257
|
+
[@yozora/tokenizer-autolink]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/autolink#readme
|
|
258
|
+
[@yozora/tokenizer-autolink-extension]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/autolink-extension#readme
|
|
259
|
+
[@yozora/tokenizer-blockquote]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/blockquote#readme
|
|
260
|
+
[@yozora/tokenizer-break]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/break#readme
|
|
261
|
+
[@yozora/tokenizer-definition]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/definition#readme
|
|
262
|
+
[@yozora/tokenizer-delete]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/delete#readme
|
|
263
|
+
[@yozora/tokenizer-ecma-import]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/ecma-import#readme
|
|
264
|
+
[@yozora/tokenizer-emphasis]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/emphasis#readme
|
|
265
|
+
[@yozora/tokenizer-fenced-block]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/fenced-block#readme
|
|
266
|
+
[@yozora/tokenizer-fenced-code]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/fenced-code#readme
|
|
267
|
+
[@yozora/tokenizer-footnote]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/footnote#readme
|
|
268
|
+
[@yozora/tokenizer-footnote-definition]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/footnote-definition#readme
|
|
269
|
+
[@yozora/tokenizer-footnote-reference]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/footnote-reference#readme
|
|
270
|
+
[@yozora/tokenizer-heading]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/heading#readme
|
|
271
|
+
[@yozora/tokenizer-html-block]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/html-block#readme
|
|
272
|
+
[@yozora/tokenizer-html-inline]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/html-inline#readme
|
|
273
|
+
[@yozora/tokenizer-image]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/image#readme
|
|
274
|
+
[@yozora/tokenizer-image-reference]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/image-reference#readme
|
|
275
|
+
[@yozora/tokenizer-indented-code]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/indented-code#readme
|
|
276
|
+
[@yozora/tokenizer-inline-code]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/inline-code#readme
|
|
277
|
+
[@yozora/tokenizer-inline-math]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/inline-math#readme
|
|
278
|
+
[@yozora/tokenizer-link]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/link#readme
|
|
279
|
+
[@yozora/tokenizer-link-reference]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/link-reference#readme
|
|
280
|
+
[@yozora/tokenizer-list]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/list#readme
|
|
281
|
+
[@yozora/tokenizer-math]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/math#readme
|
|
282
|
+
[@yozora/tokenizer-paragraph]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/paragraph#readme
|
|
283
|
+
[@yozora/tokenizer-setext-heading]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/setext-heading#readme
|
|
284
|
+
[@yozora/tokenizer-table]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/table#readme
|
|
285
|
+
[@yozora/tokenizer-text]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/text#readme
|
|
286
|
+
[@yozora/tokenizer-thematic-break]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/thematic-break#readme
|
|
287
287
|
|
|
288
288
|
[@yozora/react-admonition]: https://github.com/yozorajs/yozora-react/tree/main/packages/admonition#readme
|
|
289
289
|
[@yozora/react-blockquote]: https://github.com/yozorajs/yozora-react/tree/main/packages/blockquote#readme
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,6 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { INodePoint, INodeInterval } from '@yozora/character';
|
|
2
|
+
import { IPartialYastBlockToken, IYastBlockToken, ITokenizer, IBaseBlockTokenizerProps, IMatchBlockHookCreator, IParseBlockHookCreator, BaseBlockTokenizer, IBlockTokenizer } from '@yozora/core-tokenizer';
|
|
3
|
+
import { FootnoteDefinitionType, FootnoteDefinition } from '@yozora/ast';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Try to match a footnote label.
|
|
7
|
+
*
|
|
8
|
+
* Unlike the link label, the footnote label should be on the same line and it
|
|
9
|
+
* begins with a left bracket ([) followed by a caret (^), and ends with the
|
|
10
|
+
* first right bracket (]) that is not backslash-escaped. Between the caret of
|
|
11
|
+
* right bracket, there must be at least one non-whitespace character.
|
|
12
|
+
* Unescaped square bracket characters are not allowed inside the opening creat
|
|
13
|
+
* and closing square bracket of footnote labels. A footnote label can have at
|
|
14
|
+
* most 999 characters inside the caret and right bracket.
|
|
15
|
+
*
|
|
16
|
+
* @param nodePoints
|
|
17
|
+
* @param firstNonWhitespaceIndex
|
|
18
|
+
* @param endIndex
|
|
19
|
+
* @see https://github.github.com/gfm/#link-label
|
|
20
|
+
*/
|
|
21
|
+
declare function eatFootnoteLabel(nodePoints: ReadonlyArray<INodePoint>, firstNonWhitespaceIndex: number, endIndex: number): number;
|
|
22
|
+
|
|
23
|
+
declare type T = FootnoteDefinitionType;
|
|
24
|
+
declare type INode = FootnoteDefinition;
|
|
25
|
+
declare const uniqueName = "@yozora/tokenizer-footnote-definition";
|
|
26
|
+
interface IToken extends IPartialYastBlockToken<T> {
|
|
27
|
+
/**
|
|
28
|
+
* Footnote label
|
|
29
|
+
*/
|
|
30
|
+
label: INodeInterval & {
|
|
31
|
+
nodePoints: ReadonlyArray<INodePoint>;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
children: IYastBlockToken[];
|
|
37
|
+
/**
|
|
38
|
+
* Resolved definition label.
|
|
39
|
+
*/
|
|
40
|
+
_label?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Resolved definition identifier.
|
|
43
|
+
*/
|
|
44
|
+
_identifier?: string;
|
|
45
|
+
}
|
|
46
|
+
interface IThis extends ITokenizer {
|
|
47
|
+
indent: number;
|
|
48
|
+
}
|
|
49
|
+
declare type ITokenizerProps = Partial<IBaseBlockTokenizerProps>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A footnote reference definition consists of a footnote label, indented up
|
|
53
|
+
* to three spaces, followed by a colon (:), optional whitespace (including up
|
|
54
|
+
* to one line ending), a footnote contents consisted by paragraph-like strings.
|
|
55
|
+
*
|
|
56
|
+
* Unlike the link label, the footnote label should be on the same line and it
|
|
57
|
+
* begins with a left bracket ([) followed by a caret (^), and ends with the
|
|
58
|
+
* first right bracket (]) that is not backslash-escaped. Between the caret of
|
|
59
|
+
* right bracket, there must be at least one non-whitespace character.
|
|
60
|
+
* Unescaped square bracket characters are not allowed inside the opening creat
|
|
61
|
+
* and closing square bracket of footnote labels. A footnote label can have at
|
|
62
|
+
* most 999 characters inside the caret and right bracket.
|
|
63
|
+
*
|
|
64
|
+
* @see https://github.github.com/gfm/#link-label
|
|
65
|
+
* @see https://github.github.com/gfm/#link-reference-definition
|
|
66
|
+
* @see https://github.com/syntax-tree/mdast-util-footnote
|
|
67
|
+
* @see https://github.com/remarkjs/remark-footnotes
|
|
68
|
+
* @see https://www.markdownguide.org/extended-syntax/#footnotes
|
|
69
|
+
*/
|
|
70
|
+
declare const match: IMatchBlockHookCreator<T, IToken, IThis>;
|
|
71
|
+
|
|
72
|
+
declare const parse: IParseBlockHookCreator<T, IToken, INode, IThis>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Lexical Analyzer for FootnoteDefinition.
|
|
76
|
+
* @see https://github.github.com/gfm/#link-label
|
|
77
|
+
* @see https://github.github.com/gfm/#link-reference-definition
|
|
78
|
+
* @see https://github.com/syntax-tree/mdast-util-footnote
|
|
79
|
+
* @see https://github.com/remarkjs/remark-footnotes
|
|
80
|
+
* @see https://www.markdownguide.org/extended-syntax/#footnotes
|
|
81
|
+
*/
|
|
82
|
+
declare class FootnoteDefinitionTokenizer extends BaseBlockTokenizer<T, IToken, INode, IThis> implements IBlockTokenizer<T, IToken, INode, IThis> {
|
|
83
|
+
constructor(props?: ITokenizerProps);
|
|
84
|
+
readonly indent = 4;
|
|
85
|
+
readonly match: IMatchBlockHookCreator<T, IToken, IThis>;
|
|
86
|
+
readonly parse: IParseBlockHookCreator<T, IToken, INode, IThis>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { FootnoteDefinitionTokenizer, uniqueName as FootnoteDefinitionTokenizerName, IThis as IFootnoteDefinitionHookContext, IToken as IFootnoteDefinitionToken, ITokenizerProps as IFootnoteDefinitionTokenizerProps, FootnoteDefinitionTokenizer as default, eatFootnoteLabel, match as footnoteDefinitionMatch, parse as footnoteDefinitionParse };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozora/tokenizer-footnote-definition",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "guanghechen",
|
|
6
6
|
"url": "https://github.com/guanghechen/"
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
"url": "https://github.com/yozorajs/yozora.git",
|
|
11
11
|
"directory": "tokenizers/footnote-definition"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://
|
|
13
|
+
"homepage": "https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/footnote-definition",
|
|
14
14
|
"main": "lib/cjs/index.js",
|
|
15
15
|
"module": "lib/esm/index.js",
|
|
16
16
|
"types": "lib/types/index.d.ts",
|
|
17
17
|
"source": "src/index.ts",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"engines": {
|
|
20
|
-
"node": ">=
|
|
20
|
+
"node": ">= 16.0.0"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"lib/",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"test": "cross-env TS_NODE_FILES=true jest --config ../../jest.config.js --rootDir ."
|
|
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.2",
|
|
39
|
+
"@yozora/character": "^2.0.2",
|
|
40
|
+
"@yozora/core-tokenizer": "^2.0.2"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "6911295e9eacfa29563fe93494704190e50625fd"
|
|
43
43
|
}
|