@yozora/tokenizer-autolink-extension 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020-2021 guanghechen (me.guanghechen@gmail.com)
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-autolink-extension",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "author": {
5
5
  "name": "guanghechen",
6
6
  "url": "https://github.com/guanghechen/"
@@ -30,15 +30,15 @@
30
30
  ],
31
31
  "scripts": {
32
32
  "build": "cross-env NODE_ENV=production rollup -c ../../rollup.config.js",
33
- "prebuild": "rimraf lib/ && tsc -p tsconfig.src.json --emitDeclarationOnly",
33
+ "prebuild": "rimraf lib/",
34
34
  "prepublishOnly": "cross-env ROLLUP_SHOULD_SOURCEMAP=false yarn build",
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-autolink": "^2.0.2"
38
+ "@yozora/ast": "^2.0.3",
39
+ "@yozora/character": "^2.0.3",
40
+ "@yozora/core-tokenizer": "^2.0.3",
41
+ "@yozora/tokenizer-autolink": "^2.0.3"
42
42
  },
43
- "gitHead": "6911295e9eacfa29563fe93494704190e50625fd"
43
+ "gitHead": "8cc8f95cfebc8d752bc3272cdd24965f540c130b"
44
44
  }
@@ -1,6 +0,0 @@
1
- import type { IMatchInlineHookCreator } from '@yozora/core-tokenizer';
2
- import type { IDelimiter, IThis, IToken, T } from './types';
3
- /**
4
- * @see https://github.github.com/gfm/#autolinks-extension-
5
- */
6
- export declare const match: IMatchInlineHookCreator<T, IDelimiter, IToken, IThis>;
@@ -1,3 +0,0 @@
1
- import type { IParseInlineHookCreator } from '@yozora/core-tokenizer';
2
- import type { INode, IThis, IToken, T } from './types';
3
- export declare const parse: IParseInlineHookCreator<T, IToken, INode, IThis>;
@@ -1,13 +0,0 @@
1
- import type { IInlineTokenizer, IMatchInlineHookCreator, IParseInlineHookCreator } from '@yozora/core-tokenizer';
2
- import { BaseInlineTokenizer } from '@yozora/core-tokenizer';
3
- import type { IDelimiter, INode, IThis, IToken, ITokenizerProps, T } from './types';
4
- /**
5
- * Lexical Analyzer for Autolink (extension).
6
- *
7
- * @see https://github.github.com/gfm/#autolinks-extension-
8
- */
9
- export declare class AutolinkExtensionTokenizer extends BaseInlineTokenizer<T, IDelimiter, IToken, INode, IThis> implements IInlineTokenizer<T, IDelimiter, IToken, INode, IThis> {
10
- constructor(props?: ITokenizerProps);
11
- readonly match: IMatchInlineHookCreator<T, IDelimiter, IToken, IThis>;
12
- readonly parse: IParseInlineHookCreator<T, IToken, INode, IThis>;
13
- }
@@ -1,28 +0,0 @@
1
- import type { Link, LinkType } from '@yozora/ast';
2
- import type { INodePoint } from '@yozora/character';
3
- import type { IBaseInlineTokenizerProps, IPartialYastInlineToken, IResultOfRequiredEater, ITokenizer, IYastTokenDelimiter } from '@yozora/core-tokenizer';
4
- import type { AutolinkContentType } from '@yozora/tokenizer-autolink';
5
- export declare type T = LinkType;
6
- export declare type INode = Link;
7
- export declare const uniqueName = "@yozora/tokenizer-autolink-extension";
8
- export declare type AutolinkExtensionContentType = AutolinkContentType | 'uri-www';
9
- export interface IToken extends IPartialYastInlineToken<T> {
10
- /**
11
- * Autolink content type: absolute uri or email.
12
- */
13
- contentType: AutolinkExtensionContentType;
14
- }
15
- export interface IDelimiter extends IYastTokenDelimiter {
16
- type: 'full';
17
- /**
18
- * Autolink and autolink-extension content types.
19
- */
20
- contentType: AutolinkExtensionContentType;
21
- }
22
- export declare type IThis = ITokenizer;
23
- export declare type ITokenizerProps = Partial<IBaseInlineTokenizerProps>;
24
- export declare type ContentEater = (nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number) => IResultOfRequiredEater;
25
- export interface ContentHelper {
26
- contentType: AutolinkExtensionContentType;
27
- eat: ContentEater;
28
- }
@@ -1,16 +0,0 @@
1
- import type { INodePoint } from '@yozora/character';
2
- import type { IResultOfRequiredEater } from '@yozora/core-tokenizer';
3
- /**
4
- * An extended email autolink will be recognised when an email address is
5
- * recognised within any text node. Email addresses are recognised according to
6
- * the following rules:
7
- *
8
- * - One ore more characters which are alphanumeric, or '.', '-', '_', or '+'.
9
- * - An '@' symbol.
10
- * - One or more characters which are alphanumeric, or '-' or '_', separated
11
- * by periods (.). There must be at least one period. The last character must
12
- * not be one of '-' or '_'.
13
- *
14
- * @see https://github.github.com/gfm/#extended-email-autolink
15
- */
16
- export declare function eatExtendEmailAddress(nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number): IResultOfRequiredEater;
@@ -1,41 +0,0 @@
1
- import type { INodePoint } from '@yozora/character';
2
- import type { IResultOfOptionalEater, IResultOfRequiredEater } from '@yozora/core-tokenizer';
3
- /**
4
- * An extended url autolink will be recognised when one of the schemes 'http://',
5
- * or 'https://', followed by a valid domain, then zero or more non-space non-<
6
- * characters according to extended autolink path validation.
7
- *
8
- * @see https://github.github.com/gfm/#extended-url-autolink
9
- */
10
- export declare function eatExtendedUrl(nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number): IResultOfRequiredEater;
11
- /**
12
- * An extended www autolink will be recognised when the text 'www.' is found
13
- * followed by a valid domain
14
- */
15
- export declare function eatWWWDomain(nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number): IResultOfRequiredEater;
16
- /**
17
- * Try to eat an optional domain follows.
18
- *
19
- * After a valid domain, zero or more non-space non-'<' characters may follow.
20
- *
21
- * @param nodePoints
22
- * @param startIndex
23
- * @param endIndex
24
- * @see https://github.github.com/gfm/#extended-autolink-path-validation
25
- */
26
- export declare function eatOptionalDomainFollows(nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number): IResultOfOptionalEater;
27
- /**
28
- * A valid domain consists of segments of alphanumeric characters,
29
- * underscores (_) and hyphens (-) separated by periods (.).
30
- *
31
- * @see https://github.github.com/gfm/#valid-domain
32
- */
33
- export declare function eatValidDomain(nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number): IResultOfRequiredEater;
34
- /**
35
- * A valid domain segment consists of alphanumeric characters,
36
- * underscores (_) and hyphens (-).
37
- * @see https://github.github.com/gfm/#valid-domain
38
- */
39
- export declare function eatDomainSegment(nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number): IResultOfRequiredEater & {
40
- hasUnderscore: boolean;
41
- };