@yozora/tokenizer-autolink 2.0.2 → 2.0.4

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",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
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/ && 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"
38
+ "@yozora/ast": "^2.0.4",
39
+ "@yozora/character": "^2.0.4",
40
+ "@yozora/core-tokenizer": "^2.0.4"
41
41
  },
42
- "gitHead": "6911295e9eacfa29563fe93494704190e50625fd"
42
+ "gitHead": "c980b95254394dcacba0cbb4bea251350b09397c"
43
43
  }
@@ -1,9 +0,0 @@
1
- import type { IMatchInlineHookCreator } from '@yozora/core-tokenizer';
2
- import type { IDelimiter, IThis, IToken, T } from './types';
3
- /**
4
- * Autolinks are absolute URIs and email addresses inside '<' and '>'.
5
- * They are parsed as links, with the URL or email address as the link label.
6
- *
7
- * @see https://github.github.com/gfm/#autolink
8
- */
9
- 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,12 +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.
6
- * @see https://github.github.com/gfm/#autolink
7
- */
8
- export declare class AutolinkTokenizer extends BaseInlineTokenizer<T, IDelimiter, IToken, INode, IThis> implements IInlineTokenizer<T, IDelimiter, IToken, INode, IThis> {
9
- constructor(props?: ITokenizerProps);
10
- readonly match: IMatchInlineHookCreator<T, IDelimiter, IToken, IThis>;
11
- readonly parse: IParseInlineHookCreator<T, IToken, INode, IThis>;
12
- }
@@ -1,27 +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
- export declare type AutolinkContentType = 'uri' | 'email';
5
- export declare type T = LinkType;
6
- export declare type INode = Link;
7
- export declare const uniqueName = "@yozora/tokenizer-autolink";
8
- export interface IToken extends IPartialYastInlineToken<T> {
9
- /**
10
- * Autolink content type: absolute uri or email.
11
- */
12
- contentType: AutolinkContentType;
13
- }
14
- export interface IDelimiter extends IYastTokenDelimiter {
15
- type: 'full';
16
- /**
17
- * Autolink content type: absolute uri or email.
18
- */
19
- contentType: AutolinkContentType;
20
- }
21
- export declare type IThis = ITokenizer;
22
- export declare type ITokenizerProps = Partial<IBaseInlineTokenizerProps>;
23
- export declare type ContentEater = (nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number) => IResultOfRequiredEater;
24
- export interface IContentHelper {
25
- contentType: AutolinkContentType;
26
- eat: ContentEater;
27
- }
@@ -1,12 +0,0 @@
1
- import type { INodePoint } from '@yozora/character';
2
- import type { IResultOfRequiredEater } from '@yozora/core-tokenizer';
3
- /**
4
- * An email address, for these purposes, is anything that matches the
5
- * non-normative regex from the HTML5 spec:
6
- *
7
- * /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}
8
- * [a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
9
- *
10
- * @see https://github.github.com/gfm/#email-address
11
- */
12
- export declare function eatEmailAddress(nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number): IResultOfRequiredEater;
@@ -1,23 +0,0 @@
1
- import type { INodePoint } from '@yozora/character';
2
- import type { IResultOfRequiredEater } from '@yozora/core-tokenizer';
3
- /**
4
- * Try to find to autolink absolute uri strictly start from the give `startIndex`.
5
- *
6
- * An absolute URI, for these purposes, consists of a scheme followed by a
7
- * colon (:) followed by zero or more characters other than ASCII whitespace
8
- * and control characters, `<`, and `>`. If the URI includes these characters,
9
- * they must be percent-encoded (e.g. %20 for a space).
10
- *
11
- * @see https://github.github.com/gfm/#absolute-uri
12
- */
13
- export declare function eatAbsoluteUri(nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number): IResultOfRequiredEater;
14
- /**
15
- * Try to find to autolink schema strictly start from the give `startIndex`.
16
- *
17
- * A scheme is any sequence of 2–32 characters beginning with an ASCII letter
18
- * and followed by any combination of ASCII letters, digits, or the symbols
19
- * plus (`+`), period (`.`), or hyphen (`-`).
20
- *
21
- * @see https://github.github.com/gfm/#scheme
22
- */
23
- export declare function eatAutolinkSchema(nodePoints: ReadonlyArray<INodePoint>, startIndex: number, endIndex: number): IResultOfRequiredEater;