@yozora/tokenizer-image-reference 2.0.2-alpha.0 → 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 +61 -5
- package/package.json +10 -10
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/image-reference#readme">@yozora/tokenizer-image-reference</a>
|
|
6
6
|
</h1>
|
|
7
7
|
<div align="center">
|
|
8
8
|
<a href="https://www.npmjs.com/package/@yozora/tokenizer-image-reference">
|
|
@@ -190,53 +190,53 @@ Name | Type | Required | Default
|
|
|
190
190
|
|
|
191
191
|
[live-examples]: https://yozora.guanghechen.com/docs/package/tokenizer-image-reference#live-examples
|
|
192
192
|
[docpage]: https://yozora.guanghechen.com/docs/package/tokenizer-image-reference
|
|
193
|
-
[homepage]: https://github.com/yozorajs/yozora/tree/
|
|
193
|
+
[homepage]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/image-reference#readme
|
|
194
194
|
[gfm-spec]: https://github.github.com/gfm
|
|
195
195
|
[mdast-homepage]: https://github.com/syntax-tree/mdast
|
|
196
196
|
|
|
197
|
-
[@yozora/ast]: https://github.com/yozorajs/yozora/tree/
|
|
198
|
-
[@yozora/ast-util]: https://github.com/yozorajs/yozora/tree/
|
|
199
|
-
[@yozora/character]: https://github.com/yozorajs/yozora/tree/
|
|
200
|
-
[@yozora/eslint-config]: https://github.com/yozorajs/yozora/tree/
|
|
201
|
-
[@yozora/core-parser]: https://github.com/yozorajs/yozora/tree/
|
|
202
|
-
[@yozora/core-tokenizer]: https://github.com/yozorajs/yozora/tree/
|
|
203
|
-
[@yozora/invariant]: https://github.com/yozorajs/yozora/tree/
|
|
204
|
-
[@yozora/jest-for-tokenizer]: https://github.com/yozorajs/yozora/tree/
|
|
205
|
-
[@yozora/parser]: https://github.com/yozorajs/yozora/tree/
|
|
206
|
-
[@yozora/parser-gfm]: https://github.com/yozorajs/yozora/tree/
|
|
207
|
-
[@yozora/parser-gfm-ex]: https://github.com/yozorajs/yozora/tree/
|
|
208
|
-
[@yozora/template-tokenizer]: https://github.com/yozorajs/yozora/tree/
|
|
209
|
-
[@yozora/tokenizer-admonition]: https://github.com/yozorajs/yozora/tree/
|
|
210
|
-
[@yozora/tokenizer-autolink]: https://github.com/yozorajs/yozora/tree/
|
|
211
|
-
[@yozora/tokenizer-autolink-extension]: https://github.com/yozorajs/yozora/tree/
|
|
212
|
-
[@yozora/tokenizer-blockquote]: https://github.com/yozorajs/yozora/tree/
|
|
213
|
-
[@yozora/tokenizer-break]: https://github.com/yozorajs/yozora/tree/
|
|
214
|
-
[@yozora/tokenizer-definition]: https://github.com/yozorajs/yozora/tree/
|
|
215
|
-
[@yozora/tokenizer-delete]: https://github.com/yozorajs/yozora/tree/
|
|
216
|
-
[@yozora/tokenizer-ecma-import]: https://github.com/yozorajs/yozora/tree/
|
|
217
|
-
[@yozora/tokenizer-emphasis]: https://github.com/yozorajs/yozora/tree/
|
|
218
|
-
[@yozora/tokenizer-fenced-block]: https://github.com/yozorajs/yozora/tree/
|
|
219
|
-
[@yozora/tokenizer-fenced-code]: https://github.com/yozorajs/yozora/tree/
|
|
220
|
-
[@yozora/tokenizer-footnote]: https://github.com/yozorajs/yozora/tree/
|
|
221
|
-
[@yozora/tokenizer-footnote-definition]: https://github.com/yozorajs/yozora/tree/
|
|
222
|
-
[@yozora/tokenizer-footnote-reference]: https://github.com/yozorajs/yozora/tree/
|
|
223
|
-
[@yozora/tokenizer-heading]: https://github.com/yozorajs/yozora/tree/
|
|
224
|
-
[@yozora/tokenizer-html-block]: https://github.com/yozorajs/yozora/tree/
|
|
225
|
-
[@yozora/tokenizer-html-inline]: https://github.com/yozorajs/yozora/tree/
|
|
226
|
-
[@yozora/tokenizer-image]: https://github.com/yozorajs/yozora/tree/
|
|
227
|
-
[@yozora/tokenizer-image-reference]: https://github.com/yozorajs/yozora/tree/
|
|
228
|
-
[@yozora/tokenizer-indented-code]: https://github.com/yozorajs/yozora/tree/
|
|
229
|
-
[@yozora/tokenizer-inline-code]: https://github.com/yozorajs/yozora/tree/
|
|
230
|
-
[@yozora/tokenizer-inline-math]: https://github.com/yozorajs/yozora/tree/
|
|
231
|
-
[@yozora/tokenizer-link]: https://github.com/yozorajs/yozora/tree/
|
|
232
|
-
[@yozora/tokenizer-link-reference]: https://github.com/yozorajs/yozora/tree/
|
|
233
|
-
[@yozora/tokenizer-list]: https://github.com/yozorajs/yozora/tree/
|
|
234
|
-
[@yozora/tokenizer-math]: https://github.com/yozorajs/yozora/tree/
|
|
235
|
-
[@yozora/tokenizer-paragraph]: https://github.com/yozorajs/yozora/tree/
|
|
236
|
-
[@yozora/tokenizer-setext-heading]: https://github.com/yozorajs/yozora/tree/
|
|
237
|
-
[@yozora/tokenizer-table]: https://github.com/yozorajs/yozora/tree/
|
|
238
|
-
[@yozora/tokenizer-text]: https://github.com/yozorajs/yozora/tree/
|
|
239
|
-
[@yozora/tokenizer-thematic-break]: https://github.com/yozorajs/yozora/tree/
|
|
197
|
+
[@yozora/ast]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/ast#readme
|
|
198
|
+
[@yozora/ast-util]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/ast-util#readme
|
|
199
|
+
[@yozora/character]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/character#readme
|
|
200
|
+
[@yozora/eslint-config]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/eslint-config#readme
|
|
201
|
+
[@yozora/core-parser]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/core-parser#readme
|
|
202
|
+
[@yozora/core-tokenizer]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/core-tokenizer#readme
|
|
203
|
+
[@yozora/invariant]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/invariant#readme
|
|
204
|
+
[@yozora/jest-for-tokenizer]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/jest-for-tokenizer#readme
|
|
205
|
+
[@yozora/parser]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/parser#readme
|
|
206
|
+
[@yozora/parser-gfm]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/parser-gfm#readme
|
|
207
|
+
[@yozora/parser-gfm-ex]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/parser-gfm-ex#readme
|
|
208
|
+
[@yozora/template-tokenizer]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/template-tokenizer#readme
|
|
209
|
+
[@yozora/tokenizer-admonition]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/admonition#readme
|
|
210
|
+
[@yozora/tokenizer-autolink]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/autolink#readme
|
|
211
|
+
[@yozora/tokenizer-autolink-extension]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/autolink-extension#readme
|
|
212
|
+
[@yozora/tokenizer-blockquote]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/blockquote#readme
|
|
213
|
+
[@yozora/tokenizer-break]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/break#readme
|
|
214
|
+
[@yozora/tokenizer-definition]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/definition#readme
|
|
215
|
+
[@yozora/tokenizer-delete]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/delete#readme
|
|
216
|
+
[@yozora/tokenizer-ecma-import]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/ecma-import#readme
|
|
217
|
+
[@yozora/tokenizer-emphasis]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/emphasis#readme
|
|
218
|
+
[@yozora/tokenizer-fenced-block]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/fenced-block#readme
|
|
219
|
+
[@yozora/tokenizer-fenced-code]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/fenced-code#readme
|
|
220
|
+
[@yozora/tokenizer-footnote]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/footnote#readme
|
|
221
|
+
[@yozora/tokenizer-footnote-definition]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/footnote-definition#readme
|
|
222
|
+
[@yozora/tokenizer-footnote-reference]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/footnote-reference#readme
|
|
223
|
+
[@yozora/tokenizer-heading]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/heading#readme
|
|
224
|
+
[@yozora/tokenizer-html-block]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/html-block#readme
|
|
225
|
+
[@yozora/tokenizer-html-inline]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/html-inline#readme
|
|
226
|
+
[@yozora/tokenizer-image]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/image#readme
|
|
227
|
+
[@yozora/tokenizer-image-reference]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/image-reference#readme
|
|
228
|
+
[@yozora/tokenizer-indented-code]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/indented-code#readme
|
|
229
|
+
[@yozora/tokenizer-inline-code]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/inline-code#readme
|
|
230
|
+
[@yozora/tokenizer-inline-math]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/inline-math#readme
|
|
231
|
+
[@yozora/tokenizer-link]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/link#readme
|
|
232
|
+
[@yozora/tokenizer-link-reference]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/link-reference#readme
|
|
233
|
+
[@yozora/tokenizer-list]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/list#readme
|
|
234
|
+
[@yozora/tokenizer-math]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/math#readme
|
|
235
|
+
[@yozora/tokenizer-paragraph]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/paragraph#readme
|
|
236
|
+
[@yozora/tokenizer-setext-heading]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/setext-heading#readme
|
|
237
|
+
[@yozora/tokenizer-table]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/table#readme
|
|
238
|
+
[@yozora/tokenizer-text]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/text#readme
|
|
239
|
+
[@yozora/tokenizer-thematic-break]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/thematic-break#readme
|
|
240
240
|
|
|
241
241
|
[@yozora/react-admonition]: https://github.com/yozorajs/yozora-react/tree/main/packages/admonition#readme
|
|
242
242
|
[@yozora/react-blockquote]: https://github.com/yozorajs/yozora-react/tree/main/packages/blockquote#readme
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { IPartialYastInlineToken, ITokenizer, IBaseInlineTokenizerProps, IYastTokenDelimiter, IMatchInlineHookCreator, IParseInlineHookCreator, BaseInlineTokenizer, IInlineTokenizer } from '@yozora/core-tokenizer';
|
|
2
|
+
import { Association, Reference, ImageReferenceType, ImageReference } from '@yozora/ast';
|
|
3
|
+
import { ILinkReferenceDelimiterBracket } from '@yozora/tokenizer-link-reference';
|
|
4
|
+
|
|
5
|
+
declare const uniqueName = "@yozora/tokenizer-image-reference";
|
|
6
|
+
declare type T = ImageReferenceType;
|
|
7
|
+
declare type INode = ImageReference;
|
|
8
|
+
interface IToken extends IPartialYastInlineToken<T>, Association, Reference {
|
|
9
|
+
}
|
|
10
|
+
interface IDelimiter extends IYastTokenDelimiter {
|
|
11
|
+
brackets: ILinkReferenceDelimiterBracket[];
|
|
12
|
+
}
|
|
13
|
+
declare type IThis = ITokenizer;
|
|
14
|
+
declare type ITokenizerProps = Partial<IBaseInlineTokenizerProps>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Syntax for image-references is like the syntax for link-references, with one
|
|
18
|
+
* difference. Instead of link text, we have an image description. The rules for
|
|
19
|
+
* this are the same as for link text, except that
|
|
20
|
+
*
|
|
21
|
+
* a) an image description starts with '![' rather than '[', and
|
|
22
|
+
* b) an image description may contain links.
|
|
23
|
+
*
|
|
24
|
+
* An image description has inline elements as its contents. When an image is
|
|
25
|
+
* rendered to HTML, this is standardly used as the image’s alt attribute.
|
|
26
|
+
*
|
|
27
|
+
* One type of opener delimiter: '!['
|
|
28
|
+
*
|
|
29
|
+
* Three types of closer delimiter: ']', '][]' something like '][bar]'
|
|
30
|
+
*
|
|
31
|
+
* ------
|
|
32
|
+
*
|
|
33
|
+
* A 'opener' type delimiter is one of the following forms:
|
|
34
|
+
*
|
|
35
|
+
* - '!['
|
|
36
|
+
*
|
|
37
|
+
* A 'closer' type delimiter is one of the following forms:
|
|
38
|
+
*
|
|
39
|
+
* - ']'
|
|
40
|
+
* - '][]'
|
|
41
|
+
* - '][identifier]'
|
|
42
|
+
*
|
|
43
|
+
* @see https://github.com/syntax-tree/mdast#imagereference
|
|
44
|
+
* @see https://github.github.com/gfm/#images
|
|
45
|
+
*/
|
|
46
|
+
declare const match: IMatchInlineHookCreator<T, IDelimiter, IToken, IThis>;
|
|
47
|
+
|
|
48
|
+
declare const parse: IParseInlineHookCreator<T, IToken, INode, IThis>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Lexical Analyzer for ImageReference.
|
|
52
|
+
* @see https://github.com/syntax-tree/mdast#imagereference
|
|
53
|
+
* @see https://github.github.com/gfm/#images
|
|
54
|
+
*/
|
|
55
|
+
declare class ImageReferenceTokenizer extends BaseInlineTokenizer<T, IDelimiter, IToken, INode, IThis> implements IInlineTokenizer<T, IDelimiter, IToken, INode, IThis> {
|
|
56
|
+
constructor(props?: ITokenizerProps);
|
|
57
|
+
readonly match: IMatchInlineHookCreator<T, IDelimiter, IToken, IThis>;
|
|
58
|
+
readonly parse: IParseInlineHookCreator<T, IToken, INode, IThis>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { IThis as IImageReferenceHookContext, IToken as IImageReferenceToken, ITokenizerProps as IImageReferenceTokenizerProps, ImageReferenceTokenizer, uniqueName as ImageReferenceTokenizerName, ImageReferenceTokenizer as default, match as imageReferenceMatch, parse as imageReferenceParse };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozora/tokenizer-image-reference",
|
|
3
|
-
"version": "2.0.2
|
|
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/image-reference"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://
|
|
13
|
+
"homepage": "https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/image-reference",
|
|
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,12 +35,12 @@
|
|
|
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.2
|
|
39
|
-
"@yozora/character": "^2.0.2
|
|
40
|
-
"@yozora/core-tokenizer": "^2.0.2
|
|
41
|
-
"@yozora/tokenizer-image": "^2.0.2
|
|
42
|
-
"@yozora/tokenizer-link": "^2.0.2
|
|
43
|
-
"@yozora/tokenizer-link-reference": "^2.0.2
|
|
38
|
+
"@yozora/ast": "^2.0.2",
|
|
39
|
+
"@yozora/character": "^2.0.2",
|
|
40
|
+
"@yozora/core-tokenizer": "^2.0.2",
|
|
41
|
+
"@yozora/tokenizer-image": "^2.0.2",
|
|
42
|
+
"@yozora/tokenizer-link": "^2.0.2",
|
|
43
|
+
"@yozora/tokenizer-link-reference": "^2.0.2"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "6911295e9eacfa29563fe93494704190e50625fd"
|
|
46
46
|
}
|