🎉 initiate project *astro_rewrite*
This commit is contained in:
parent
ffd4d5e86c
commit
2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions
63
node_modules/micromark-util-character/dev/index.d.ts
generated
vendored
Normal file
63
node_modules/micromark-util-character/dev/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/**
|
||||
* Check whether a character code is an ASCII control character.
|
||||
*
|
||||
* An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
|
||||
* to U+001F (US), or U+007F (DEL).
|
||||
*
|
||||
* @param {Code} code
|
||||
* Code.
|
||||
* @returns {boolean}
|
||||
* Whether it matches.
|
||||
*/
|
||||
export function asciiControl(code: Code): boolean
|
||||
/**
|
||||
* Check whether a character code is a markdown line ending.
|
||||
*
|
||||
* A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
|
||||
* LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
|
||||
*
|
||||
* In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
|
||||
* RETURN (CR) are replaced by these virtual characters depending on whether
|
||||
* they occurred together.
|
||||
*
|
||||
* @param {Code} code
|
||||
* Code.
|
||||
* @returns {boolean}
|
||||
* Whether it matches.
|
||||
*/
|
||||
export function markdownLineEnding(code: Code): boolean
|
||||
/**
|
||||
* Check whether a character code is a markdown line ending (see
|
||||
* `markdownLineEnding`) or markdown space (see `markdownSpace`).
|
||||
*
|
||||
* @param {Code} code
|
||||
* Code.
|
||||
* @returns {boolean}
|
||||
* Whether it matches.
|
||||
*/
|
||||
export function markdownLineEndingOrSpace(code: Code): boolean
|
||||
/**
|
||||
* Check whether a character code is a markdown space.
|
||||
*
|
||||
* A **markdown space** is the concrete character U+0020 SPACE (SP) and the
|
||||
* virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
|
||||
*
|
||||
* In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
|
||||
* replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
|
||||
* SPACE (VS) characters, depending on the column at which the tab occurred.
|
||||
*
|
||||
* @param {Code} code
|
||||
* Code.
|
||||
* @returns {boolean}
|
||||
* Whether it matches.
|
||||
*/
|
||||
export function markdownSpace(code: Code): boolean
|
||||
export function asciiAlpha(code: Code): boolean
|
||||
export function asciiAlphanumeric(code: Code): boolean
|
||||
export function asciiAtext(code: Code): boolean
|
||||
export function asciiDigit(code: Code): boolean
|
||||
export function asciiHexDigit(code: Code): boolean
|
||||
export function asciiPunctuation(code: Code): boolean
|
||||
export function unicodePunctuation(code: Code): boolean
|
||||
export function unicodeWhitespace(code: Code): boolean
|
||||
export type Code = import('micromark-util-types').Code
|
||||
251
node_modules/micromark-util-character/dev/index.js
generated
vendored
Normal file
251
node_modules/micromark-util-character/dev/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,251 @@
|
|||
/**
|
||||
* @typedef {import('micromark-util-types').Code} Code
|
||||
*/
|
||||
|
||||
import {codes} from 'micromark-util-symbol/codes.js'
|
||||
import {unicodePunctuationRegex} from './lib/unicode-punctuation-regex.js'
|
||||
|
||||
/**
|
||||
* Check whether the character code represents an ASCII alpha (`a` through `z`,
|
||||
* case insensitive).
|
||||
*
|
||||
* An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
|
||||
*
|
||||
* An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
|
||||
* to U+005A (`Z`).
|
||||
*
|
||||
* An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
|
||||
* to U+007A (`z`).
|
||||
*
|
||||
* @param code
|
||||
* Code.
|
||||
* @returns
|
||||
* Whether it matches.
|
||||
*/
|
||||
export const asciiAlpha = regexCheck(/[A-Za-z]/)
|
||||
|
||||
/**
|
||||
* Check whether the character code represents an ASCII alphanumeric (`a`
|
||||
* through `z`, case insensitive, or `0` through `9`).
|
||||
*
|
||||
* An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
|
||||
* (see `asciiAlpha`).
|
||||
*
|
||||
* @param code
|
||||
* Code.
|
||||
* @returns
|
||||
* Whether it matches.
|
||||
*/
|
||||
export const asciiAlphanumeric = regexCheck(/[\dA-Za-z]/)
|
||||
|
||||
/**
|
||||
* Check whether the character code represents an ASCII atext.
|
||||
*
|
||||
* atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
|
||||
* the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
|
||||
* U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
|
||||
* SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
|
||||
* CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
|
||||
* (`{`) to U+007E TILDE (`~`).
|
||||
*
|
||||
* See:
|
||||
* **\[RFC5322]**:
|
||||
* [Internet Message Format](https://tools.ietf.org/html/rfc5322).
|
||||
* P. Resnick.
|
||||
* IETF.
|
||||
*
|
||||
* @param code
|
||||
* Code.
|
||||
* @returns
|
||||
* Whether it matches.
|
||||
*/
|
||||
export const asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/)
|
||||
|
||||
/**
|
||||
* Check whether a character code is an ASCII control character.
|
||||
*
|
||||
* An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
|
||||
* to U+001F (US), or U+007F (DEL).
|
||||
*
|
||||
* @param {Code} code
|
||||
* Code.
|
||||
* @returns {boolean}
|
||||
* Whether it matches.
|
||||
*/
|
||||
export function asciiControl(code) {
|
||||
return (
|
||||
// Special whitespace codes (which have negative values), C0 and Control
|
||||
// character DEL
|
||||
code !== null && (code < codes.space || code === codes.del)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the character code represents an ASCII digit (`0` through `9`).
|
||||
*
|
||||
* An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
|
||||
* U+0039 (`9`).
|
||||
*
|
||||
* @param code
|
||||
* Code.
|
||||
* @returns
|
||||
* Whether it matches.
|
||||
*/
|
||||
export const asciiDigit = regexCheck(/\d/)
|
||||
|
||||
/**
|
||||
* Check whether the character code represents an ASCII hex digit (`a` through
|
||||
* `f`, case insensitive, or `0` through `9`).
|
||||
*
|
||||
* An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
|
||||
* digit, or an ASCII lower hex digit.
|
||||
*
|
||||
* An **ASCII upper hex digit** is a character in the inclusive range U+0041
|
||||
* (`A`) to U+0046 (`F`).
|
||||
*
|
||||
* An **ASCII lower hex digit** is a character in the inclusive range U+0061
|
||||
* (`a`) to U+0066 (`f`).
|
||||
*
|
||||
* @param code
|
||||
* Code.
|
||||
* @returns
|
||||
* Whether it matches.
|
||||
*/
|
||||
export const asciiHexDigit = regexCheck(/[\dA-Fa-f]/)
|
||||
|
||||
/**
|
||||
* Check whether the character code represents ASCII punctuation.
|
||||
*
|
||||
* An **ASCII punctuation** is a character in the inclusive ranges U+0021
|
||||
* EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
|
||||
* SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
|
||||
* (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
|
||||
*
|
||||
* @param code
|
||||
* Code.
|
||||
* @returns
|
||||
* Whether it matches.
|
||||
*/
|
||||
export const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/)
|
||||
|
||||
/**
|
||||
* Check whether a character code is a markdown line ending.
|
||||
*
|
||||
* A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
|
||||
* LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
|
||||
*
|
||||
* In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
|
||||
* RETURN (CR) are replaced by these virtual characters depending on whether
|
||||
* they occurred together.
|
||||
*
|
||||
* @param {Code} code
|
||||
* Code.
|
||||
* @returns {boolean}
|
||||
* Whether it matches.
|
||||
*/
|
||||
export function markdownLineEnding(code) {
|
||||
return code !== null && code < codes.horizontalTab
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a character code is a markdown line ending (see
|
||||
* `markdownLineEnding`) or markdown space (see `markdownSpace`).
|
||||
*
|
||||
* @param {Code} code
|
||||
* Code.
|
||||
* @returns {boolean}
|
||||
* Whether it matches.
|
||||
*/
|
||||
export function markdownLineEndingOrSpace(code) {
|
||||
return code !== null && (code < codes.nul || code === codes.space)
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a character code is a markdown space.
|
||||
*
|
||||
* A **markdown space** is the concrete character U+0020 SPACE (SP) and the
|
||||
* virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
|
||||
*
|
||||
* In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
|
||||
* replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
|
||||
* SPACE (VS) characters, depending on the column at which the tab occurred.
|
||||
*
|
||||
* @param {Code} code
|
||||
* Code.
|
||||
* @returns {boolean}
|
||||
* Whether it matches.
|
||||
*/
|
||||
export function markdownSpace(code) {
|
||||
return (
|
||||
code === codes.horizontalTab ||
|
||||
code === codes.virtualSpace ||
|
||||
code === codes.space
|
||||
)
|
||||
}
|
||||
|
||||
// Size note: removing ASCII from the regex and using `asciiPunctuation` here
|
||||
// In fact adds to the bundle size.
|
||||
/**
|
||||
* Check whether the character code represents Unicode punctuation.
|
||||
*
|
||||
* A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
|
||||
* Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
|
||||
* (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
|
||||
* (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
|
||||
* punctuation (see `asciiPunctuation`).
|
||||
*
|
||||
* See:
|
||||
* **\[UNICODE]**:
|
||||
* [The Unicode Standard](https://www.unicode.org/versions/).
|
||||
* Unicode Consortium.
|
||||
*
|
||||
* @param code
|
||||
* Code.
|
||||
* @returns
|
||||
* Whether it matches.
|
||||
*/
|
||||
export const unicodePunctuation = regexCheck(unicodePunctuationRegex)
|
||||
|
||||
/**
|
||||
* Check whether the character code represents Unicode whitespace.
|
||||
*
|
||||
* Note that this does handle micromark specific markdown whitespace characters.
|
||||
* See `markdownLineEndingOrSpace` to check that.
|
||||
*
|
||||
* A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
|
||||
* Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
|
||||
* U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
|
||||
*
|
||||
* See:
|
||||
* **\[UNICODE]**:
|
||||
* [The Unicode Standard](https://www.unicode.org/versions/).
|
||||
* Unicode Consortium.
|
||||
*
|
||||
* @param code
|
||||
* Code.
|
||||
* @returns
|
||||
* Whether it matches.
|
||||
*/
|
||||
export const unicodeWhitespace = regexCheck(/\s/)
|
||||
|
||||
/**
|
||||
* Create a code check from a regex.
|
||||
*
|
||||
* @param {RegExp} regex
|
||||
* @returns {(code: Code) => boolean}
|
||||
*/
|
||||
function regexCheck(regex) {
|
||||
return check
|
||||
|
||||
/**
|
||||
* Check whether a code matches the bound regex.
|
||||
*
|
||||
* @param {Code} code
|
||||
* Character code.
|
||||
* @returns {boolean}
|
||||
* Whether the character code matches the bound regex.
|
||||
*/
|
||||
function check(code) {
|
||||
return code !== null && regex.test(String.fromCharCode(code))
|
||||
}
|
||||
}
|
||||
4
node_modules/micromark-util-character/dev/lib/unicode-punctuation-regex.d.ts
generated
vendored
Normal file
4
node_modules/micromark-util-character/dev/lib/unicode-punctuation-regex.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
/**
|
||||
* Regular expression that matches a unicode punctuation character.
|
||||
*/
|
||||
export const unicodePunctuationRegex: RegExp
|
||||
12
node_modules/micromark-util-character/dev/lib/unicode-punctuation-regex.js
generated
vendored
Normal file
12
node_modules/micromark-util-character/dev/lib/unicode-punctuation-regex.js
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// This module is generated by `script/`.
|
||||
//
|
||||
// CommonMark handles attention (emphasis, strong) markers based on what comes
|
||||
// before or after them.
|
||||
// One such difference is if those characters are Unicode punctuation.
|
||||
// This script is generated from the Unicode data.
|
||||
|
||||
/**
|
||||
* Regular expression that matches a unicode punctuation character.
|
||||
*/
|
||||
export const unicodePunctuationRegex =
|
||||
/[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/
|
||||
63
node_modules/micromark-util-character/index.d.ts
generated
vendored
Normal file
63
node_modules/micromark-util-character/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/**
|
||||
* Check whether a character code is an ASCII control character.
|
||||
*
|
||||
* An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
|
||||
* to U+001F (US), or U+007F (DEL).
|
||||
*
|
||||
* @param {Code} code
|
||||
* Code.
|
||||
* @returns {boolean}
|
||||
* Whether it matches.
|
||||
*/
|
||||
export function asciiControl(code: Code): boolean
|
||||
/**
|
||||
* Check whether a character code is a markdown line ending.
|
||||
*
|
||||
* A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
|
||||
* LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
|
||||
*
|
||||
* In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
|
||||
* RETURN (CR) are replaced by these virtual characters depending on whether
|
||||
* they occurred together.
|
||||
*
|
||||
* @param {Code} code
|
||||
* Code.
|
||||
* @returns {boolean}
|
||||
* Whether it matches.
|
||||
*/
|
||||
export function markdownLineEnding(code: Code): boolean
|
||||
/**
|
||||
* Check whether a character code is a markdown line ending (see
|
||||
* `markdownLineEnding`) or markdown space (see `markdownSpace`).
|
||||
*
|
||||
* @param {Code} code
|
||||
* Code.
|
||||
* @returns {boolean}
|
||||
* Whether it matches.
|
||||
*/
|
||||
export function markdownLineEndingOrSpace(code: Code): boolean
|
||||
/**
|
||||
* Check whether a character code is a markdown space.
|
||||
*
|
||||
* A **markdown space** is the concrete character U+0020 SPACE (SP) and the
|
||||
* virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
|
||||
*
|
||||
* In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
|
||||
* replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
|
||||
* SPACE (VS) characters, depending on the column at which the tab occurred.
|
||||
*
|
||||
* @param {Code} code
|
||||
* Code.
|
||||
* @returns {boolean}
|
||||
* Whether it matches.
|
||||
*/
|
||||
export function markdownSpace(code: Code): boolean
|
||||
export function asciiAlpha(code: Code): boolean
|
||||
export function asciiAlphanumeric(code: Code): boolean
|
||||
export function asciiAtext(code: Code): boolean
|
||||
export function asciiDigit(code: Code): boolean
|
||||
export function asciiHexDigit(code: Code): boolean
|
||||
export function asciiPunctuation(code: Code): boolean
|
||||
export function unicodePunctuation(code: Code): boolean
|
||||
export function unicodeWhitespace(code: Code): boolean
|
||||
export type Code = import('micromark-util-types').Code
|
||||
246
node_modules/micromark-util-character/index.js
generated
vendored
Normal file
246
node_modules/micromark-util-character/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,246 @@
|
|||
/**
|
||||
* @typedef {import('micromark-util-types').Code} Code
|
||||
*/
|
||||
|
||||
import {unicodePunctuationRegex} from './lib/unicode-punctuation-regex.js'
|
||||
|
||||
/**
|
||||
* Check whether the character code represents an ASCII alpha (`a` through `z`,
|
||||
* case insensitive).
|
||||
*
|
||||
* An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
|
||||
*
|
||||
* An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
|
||||
* to U+005A (`Z`).
|
||||
*
|
||||
* An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
|
||||
* to U+007A (`z`).
|
||||
*
|
||||
* @param code
|
||||
* Code.
|
||||
* @returns
|
||||
* Whether it matches.
|
||||
*/
|
||||
export const asciiAlpha = regexCheck(/[A-Za-z]/)
|
||||
|
||||
/**
|
||||
* Check whether the character code represents an ASCII alphanumeric (`a`
|
||||
* through `z`, case insensitive, or `0` through `9`).
|
||||
*
|
||||
* An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
|
||||
* (see `asciiAlpha`).
|
||||
*
|
||||
* @param code
|
||||
* Code.
|
||||
* @returns
|
||||
* Whether it matches.
|
||||
*/
|
||||
export const asciiAlphanumeric = regexCheck(/[\dA-Za-z]/)
|
||||
|
||||
/**
|
||||
* Check whether the character code represents an ASCII atext.
|
||||
*
|
||||
* atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
|
||||
* the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
|
||||
* U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
|
||||
* SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
|
||||
* CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
|
||||
* (`{`) to U+007E TILDE (`~`).
|
||||
*
|
||||
* See:
|
||||
* **\[RFC5322]**:
|
||||
* [Internet Message Format](https://tools.ietf.org/html/rfc5322).
|
||||
* P. Resnick.
|
||||
* IETF.
|
||||
*
|
||||
* @param code
|
||||
* Code.
|
||||
* @returns
|
||||
* Whether it matches.
|
||||
*/
|
||||
export const asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/)
|
||||
|
||||
/**
|
||||
* Check whether a character code is an ASCII control character.
|
||||
*
|
||||
* An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
|
||||
* to U+001F (US), or U+007F (DEL).
|
||||
*
|
||||
* @param {Code} code
|
||||
* Code.
|
||||
* @returns {boolean}
|
||||
* Whether it matches.
|
||||
*/
|
||||
export function asciiControl(code) {
|
||||
return (
|
||||
// Special whitespace codes (which have negative values), C0 and Control
|
||||
// character DEL
|
||||
code !== null && (code < 32 || code === 127)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the character code represents an ASCII digit (`0` through `9`).
|
||||
*
|
||||
* An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
|
||||
* U+0039 (`9`).
|
||||
*
|
||||
* @param code
|
||||
* Code.
|
||||
* @returns
|
||||
* Whether it matches.
|
||||
*/
|
||||
export const asciiDigit = regexCheck(/\d/)
|
||||
|
||||
/**
|
||||
* Check whether the character code represents an ASCII hex digit (`a` through
|
||||
* `f`, case insensitive, or `0` through `9`).
|
||||
*
|
||||
* An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
|
||||
* digit, or an ASCII lower hex digit.
|
||||
*
|
||||
* An **ASCII upper hex digit** is a character in the inclusive range U+0041
|
||||
* (`A`) to U+0046 (`F`).
|
||||
*
|
||||
* An **ASCII lower hex digit** is a character in the inclusive range U+0061
|
||||
* (`a`) to U+0066 (`f`).
|
||||
*
|
||||
* @param code
|
||||
* Code.
|
||||
* @returns
|
||||
* Whether it matches.
|
||||
*/
|
||||
export const asciiHexDigit = regexCheck(/[\dA-Fa-f]/)
|
||||
|
||||
/**
|
||||
* Check whether the character code represents ASCII punctuation.
|
||||
*
|
||||
* An **ASCII punctuation** is a character in the inclusive ranges U+0021
|
||||
* EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
|
||||
* SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
|
||||
* (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
|
||||
*
|
||||
* @param code
|
||||
* Code.
|
||||
* @returns
|
||||
* Whether it matches.
|
||||
*/
|
||||
export const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/)
|
||||
|
||||
/**
|
||||
* Check whether a character code is a markdown line ending.
|
||||
*
|
||||
* A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
|
||||
* LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
|
||||
*
|
||||
* In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
|
||||
* RETURN (CR) are replaced by these virtual characters depending on whether
|
||||
* they occurred together.
|
||||
*
|
||||
* @param {Code} code
|
||||
* Code.
|
||||
* @returns {boolean}
|
||||
* Whether it matches.
|
||||
*/
|
||||
export function markdownLineEnding(code) {
|
||||
return code !== null && code < -2
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a character code is a markdown line ending (see
|
||||
* `markdownLineEnding`) or markdown space (see `markdownSpace`).
|
||||
*
|
||||
* @param {Code} code
|
||||
* Code.
|
||||
* @returns {boolean}
|
||||
* Whether it matches.
|
||||
*/
|
||||
export function markdownLineEndingOrSpace(code) {
|
||||
return code !== null && (code < 0 || code === 32)
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a character code is a markdown space.
|
||||
*
|
||||
* A **markdown space** is the concrete character U+0020 SPACE (SP) and the
|
||||
* virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
|
||||
*
|
||||
* In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
|
||||
* replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
|
||||
* SPACE (VS) characters, depending on the column at which the tab occurred.
|
||||
*
|
||||
* @param {Code} code
|
||||
* Code.
|
||||
* @returns {boolean}
|
||||
* Whether it matches.
|
||||
*/
|
||||
export function markdownSpace(code) {
|
||||
return code === -2 || code === -1 || code === 32
|
||||
}
|
||||
|
||||
// Size note: removing ASCII from the regex and using `asciiPunctuation` here
|
||||
// In fact adds to the bundle size.
|
||||
/**
|
||||
* Check whether the character code represents Unicode punctuation.
|
||||
*
|
||||
* A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
|
||||
* Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
|
||||
* (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
|
||||
* (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
|
||||
* punctuation (see `asciiPunctuation`).
|
||||
*
|
||||
* See:
|
||||
* **\[UNICODE]**:
|
||||
* [The Unicode Standard](https://www.unicode.org/versions/).
|
||||
* Unicode Consortium.
|
||||
*
|
||||
* @param code
|
||||
* Code.
|
||||
* @returns
|
||||
* Whether it matches.
|
||||
*/
|
||||
export const unicodePunctuation = regexCheck(unicodePunctuationRegex)
|
||||
|
||||
/**
|
||||
* Check whether the character code represents Unicode whitespace.
|
||||
*
|
||||
* Note that this does handle micromark specific markdown whitespace characters.
|
||||
* See `markdownLineEndingOrSpace` to check that.
|
||||
*
|
||||
* A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
|
||||
* Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
|
||||
* U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
|
||||
*
|
||||
* See:
|
||||
* **\[UNICODE]**:
|
||||
* [The Unicode Standard](https://www.unicode.org/versions/).
|
||||
* Unicode Consortium.
|
||||
*
|
||||
* @param code
|
||||
* Code.
|
||||
* @returns
|
||||
* Whether it matches.
|
||||
*/
|
||||
export const unicodeWhitespace = regexCheck(/\s/)
|
||||
|
||||
/**
|
||||
* Create a code check from a regex.
|
||||
*
|
||||
* @param {RegExp} regex
|
||||
* @returns {(code: Code) => boolean}
|
||||
*/
|
||||
function regexCheck(regex) {
|
||||
return check
|
||||
|
||||
/**
|
||||
* Check whether a code matches the bound regex.
|
||||
*
|
||||
* @param {Code} code
|
||||
* Character code.
|
||||
* @returns {boolean}
|
||||
* Whether the character code matches the bound regex.
|
||||
*/
|
||||
function check(code) {
|
||||
return code !== null && regex.test(String.fromCharCode(code))
|
||||
}
|
||||
}
|
||||
4
node_modules/micromark-util-character/lib/unicode-punctuation-regex.d.ts
generated
vendored
Normal file
4
node_modules/micromark-util-character/lib/unicode-punctuation-regex.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
/**
|
||||
* Regular expression that matches a unicode punctuation character.
|
||||
*/
|
||||
export const unicodePunctuationRegex: RegExp
|
||||
12
node_modules/micromark-util-character/lib/unicode-punctuation-regex.js
generated
vendored
Normal file
12
node_modules/micromark-util-character/lib/unicode-punctuation-regex.js
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// This module is generated by `script/`.
|
||||
//
|
||||
// CommonMark handles attention (emphasis, strong) markers based on what comes
|
||||
// before or after them.
|
||||
// One such difference is if those characters are Unicode punctuation.
|
||||
// This script is generated from the Unicode data.
|
||||
|
||||
/**
|
||||
* Regular expression that matches a unicode punctuation character.
|
||||
*/
|
||||
export const unicodePunctuationRegex =
|
||||
/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/
|
||||
57
node_modules/micromark-util-character/package.json
generated
vendored
Normal file
57
node_modules/micromark-util-character/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
"name": "micromark-util-character",
|
||||
"version": "1.2.0",
|
||||
"description": "micromark utility to handle character codes",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"micromark",
|
||||
"util",
|
||||
"utility",
|
||||
"character"
|
||||
],
|
||||
"repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-util-character",
|
||||
"bugs": "https://github.com/micromark/micromark/issues",
|
||||
"funding": [
|
||||
{
|
||||
"type": "GitHub Sponsors",
|
||||
"url": "https://github.com/sponsors/unifiedjs"
|
||||
},
|
||||
{
|
||||
"type": "OpenCollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
],
|
||||
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
|
||||
"contributors": [
|
||||
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"types": "dev/index.d.ts",
|
||||
"files": [
|
||||
"dev/",
|
||||
"lib/",
|
||||
"index.d.ts",
|
||||
"index.js"
|
||||
],
|
||||
"exports": {
|
||||
"types": "./dev/index.d.ts",
|
||||
"development": "./dev/index.js",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"micromark-util-symbol": "^1.0.0",
|
||||
"micromark-util-types": "^1.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "micromark-build"
|
||||
},
|
||||
"xo": false,
|
||||
"typeCoverage": {
|
||||
"atLeast": 100,
|
||||
"detail": true,
|
||||
"strict": true,
|
||||
"ignoreCatch": true
|
||||
}
|
||||
}
|
||||
444
node_modules/micromark-util-character/readme.md
generated
vendored
Normal file
444
node_modules/micromark-util-character/readme.md
generated
vendored
Normal file
|
|
@ -0,0 +1,444 @@
|
|||
# micromark-util-character
|
||||
|
||||
[![Build][build-badge]][build]
|
||||
[![Coverage][coverage-badge]][coverage]
|
||||
[![Downloads][downloads-badge]][downloads]
|
||||
[![Size][bundle-size-badge]][bundle-size]
|
||||
[![Sponsors][sponsors-badge]][opencollective]
|
||||
[![Backers][backers-badge]][opencollective]
|
||||
[![Chat][chat-badge]][chat]
|
||||
|
||||
[micromark][] utility to handle [character codes][code].
|
||||
|
||||
## Contents
|
||||
|
||||
* [What is this?](#what-is-this)
|
||||
* [When should I use this?](#when-should-i-use-this)
|
||||
* [Install](#install)
|
||||
* [Use](#use)
|
||||
* [API](#api)
|
||||
* [`asciiAlpha(code)`](#asciialphacode)
|
||||
* [`asciiAlphanumeric(code)`](#asciialphanumericcode)
|
||||
* [`asciiAtext(code)`](#asciiatextcode)
|
||||
* [`asciiControl(code)`](#asciicontrolcode)
|
||||
* [`asciiDigit(code)`](#asciidigitcode)
|
||||
* [`asciiHexDigit(code)`](#asciihexdigitcode)
|
||||
* [`asciiPunctuation(code)`](#asciipunctuationcode)
|
||||
* [`markdownLineEnding(code)`](#markdownlineendingcode)
|
||||
* [`markdownLineEndingOrSpace(code)`](#markdownlineendingorspacecode)
|
||||
* [`markdownSpace(code)`](#markdownspacecode)
|
||||
* [`unicodePunctuation(code)`](#unicodepunctuationcode)
|
||||
* [`unicodeWhitespace(code)`](#unicodewhitespacecode)
|
||||
* [Types](#types)
|
||||
* [Compatibility](#compatibility)
|
||||
* [Security](#security)
|
||||
* [Contribute](#contribute)
|
||||
* [License](#license)
|
||||
|
||||
## What is this?
|
||||
|
||||
This package exposes algorithms to check whether characters match groups.
|
||||
|
||||
## When should I use this?
|
||||
|
||||
This package might be useful when you are making your own micromark extensions.
|
||||
|
||||
## Install
|
||||
|
||||
This package is [ESM only][esm].
|
||||
In Node.js (version 16+), install with [npm][]:
|
||||
|
||||
```sh
|
||||
npm install micromark-util-character
|
||||
```
|
||||
|
||||
In Deno with [`esm.sh`][esmsh]:
|
||||
|
||||
```js
|
||||
import * as character from 'https://esm.sh/micromark-util-character@1'
|
||||
```
|
||||
|
||||
In browsers with [`esm.sh`][esmsh]:
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import * as character from 'https://esm.sh/micromark-util-character@1?bundle'
|
||||
</script>
|
||||
```
|
||||
|
||||
## Use
|
||||
|
||||
```js
|
||||
import {asciiAlpha} from 'micromark-util-character'
|
||||
|
||||
console.log(asciiAlpha(64)) // false
|
||||
console.log(asciiAlpha(65)) // true
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
This module exports the identifiers
|
||||
[`asciiAlpha`][api-ascii-alpha],
|
||||
[`asciiAlphanumeric`][api-ascii-alphanumeric],
|
||||
[`asciiAtext`][api-ascii-atext],
|
||||
[`asciiControl`][api-ascii-control],
|
||||
[`asciiDigit`][api-ascii-digit],
|
||||
[`asciiHexDigit`][api-ascii-hex-digit],
|
||||
[`asciiPunctuation`][api-ascii-punctuation],
|
||||
[`markdownLineEnding`][api-markdown-line-ending],
|
||||
[`markdownLineEndingOrSpace`][api-markdown-line-ending-or-space],
|
||||
[`markdownSpace`][api-markdown-space],
|
||||
[`unicodePunctuation`][api-unicode-punctuation],
|
||||
[`unicodeWhitespace`][api-unicode-whitespace].
|
||||
There is no default export.
|
||||
|
||||
### `asciiAlpha(code)`
|
||||
|
||||
Check whether the [character code][code] represents an ASCII alpha (`a` through
|
||||
`z`, case insensitive).
|
||||
|
||||
An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
|
||||
|
||||
An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
|
||||
to U+005A (`Z`).
|
||||
|
||||
An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
|
||||
to U+007A (`z`).
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `code` (`Code`)
|
||||
— code
|
||||
|
||||
###### Returns
|
||||
|
||||
Whether it matches (`boolean`).
|
||||
|
||||
### `asciiAlphanumeric(code)`
|
||||
|
||||
Check whether the [character code][code] represents an ASCII alphanumeric (`a`
|
||||
through `z`, case insensitive, or `0` through `9`).
|
||||
|
||||
An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
|
||||
(see `asciiAlpha`).
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `code` (`Code`)
|
||||
— code
|
||||
|
||||
###### Returns
|
||||
|
||||
Whether it matches (`boolean`).
|
||||
|
||||
### `asciiAtext(code)`
|
||||
|
||||
Check whether the [character code][code] represents an ASCII atext.
|
||||
|
||||
atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
|
||||
the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
|
||||
U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
|
||||
SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
|
||||
CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
|
||||
(`{`) to U+007E TILDE (`~`) (**\[RFC5322]**).
|
||||
|
||||
See **\[RFC5322]**:\
|
||||
[Internet Message Format](https://tools.ietf.org/html/rfc5322).\
|
||||
P. Resnick.\
|
||||
IETF.
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `code` (`Code`)
|
||||
— code
|
||||
|
||||
###### Returns
|
||||
|
||||
Whether it matches (`boolean`).
|
||||
|
||||
### `asciiControl(code)`
|
||||
|
||||
Check whether a [character code][code] is an ASCII control character.
|
||||
|
||||
An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
|
||||
to U+001F (US), or U+007F (DEL).
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `code` (`Code`)
|
||||
— code
|
||||
|
||||
###### Returns
|
||||
|
||||
Whether it matches (`boolean`).
|
||||
|
||||
### `asciiDigit(code)`
|
||||
|
||||
Check whether the [character code][code] represents an ASCII digit (`0` through
|
||||
`9`).
|
||||
|
||||
An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
|
||||
U+0039 (`9`).
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `code` (`Code`)
|
||||
— code
|
||||
|
||||
###### Returns
|
||||
|
||||
Whether it matches (`boolean`).
|
||||
|
||||
### `asciiHexDigit(code)`
|
||||
|
||||
Check whether the [character code][code] represents an ASCII hex digit (`a`
|
||||
through `f`, case insensitive, or `0` through `9`).
|
||||
|
||||
An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
|
||||
digit, or an ASCII lower hex digit.
|
||||
|
||||
An **ASCII upper hex digit** is a character in the inclusive range U+0041
|
||||
(`A`) to U+0046 (`F`).
|
||||
|
||||
An **ASCII lower hex digit** is a character in the inclusive range U+0061
|
||||
(`a`) to U+0066 (`f`).
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `code` (`Code`)
|
||||
— code
|
||||
|
||||
###### Returns
|
||||
|
||||
Whether it matches (`boolean`).
|
||||
|
||||
### `asciiPunctuation(code)`
|
||||
|
||||
Check whether the [character code][code] represents ASCII punctuation.
|
||||
|
||||
An **ASCII punctuation** is a character in the inclusive ranges U+0021
|
||||
EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
|
||||
SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
|
||||
(`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `code` (`Code`)
|
||||
— code
|
||||
|
||||
###### Returns
|
||||
|
||||
Whether it matches (`boolean`).
|
||||
|
||||
### `markdownLineEnding(code)`
|
||||
|
||||
Check whether a [character code][code] is a markdown line ending.
|
||||
|
||||
A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
|
||||
LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
|
||||
|
||||
In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
|
||||
RETURN (CR) are replaced by these virtual characters depending on whether
|
||||
they occurred together.
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `code` (`Code`)
|
||||
— code
|
||||
|
||||
###### Returns
|
||||
|
||||
Whether it matches (`boolean`).
|
||||
|
||||
### `markdownLineEndingOrSpace(code)`
|
||||
|
||||
Check whether a [character code][code] is a markdown line ending (see
|
||||
`markdownLineEnding`) or markdown space (see `markdownSpace`).
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `code` (`Code`)
|
||||
— code
|
||||
|
||||
###### Returns
|
||||
|
||||
Whether it matches (`boolean`).
|
||||
|
||||
### `markdownSpace(code)`
|
||||
|
||||
Check whether a [character code][code] is a markdown space.
|
||||
|
||||
A **markdown space** is the concrete character U+0020 SPACE (SP) and the
|
||||
virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
|
||||
|
||||
In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
|
||||
replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
|
||||
SPACE (VS) characters, depending on the column at which the tab occurred.
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `code` (`Code`)
|
||||
— code
|
||||
|
||||
###### Returns
|
||||
|
||||
Whether it matches (`boolean`).
|
||||
|
||||
### `unicodePunctuation(code)`
|
||||
|
||||
Check whether the [character code][code] represents Unicode punctuation.
|
||||
|
||||
A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
|
||||
Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
|
||||
(Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
|
||||
(Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
|
||||
punctuation (see `asciiPunctuation`) (**\[UNICODE]**).
|
||||
|
||||
See **\[UNICODE]**:\
|
||||
[The Unicode Standard](https://www.unicode.org/versions/).\
|
||||
Unicode Consortium.
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `code` (`Code`)
|
||||
— code
|
||||
|
||||
###### Returns
|
||||
|
||||
Whether it matches (`boolean`).
|
||||
|
||||
### `unicodeWhitespace(code)`
|
||||
|
||||
Check whether the [character code][code] represents Unicode whitespace.
|
||||
|
||||
Note that this does handle micromark specific markdown whitespace characters.
|
||||
See `markdownLineEndingOrSpace` to check that.
|
||||
|
||||
A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
|
||||
Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
|
||||
U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
|
||||
|
||||
See **\[UNICODE]**:\
|
||||
[The Unicode Standard](https://www.unicode.org/versions/).\
|
||||
Unicode Consortium.
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `code` (`Code`)
|
||||
— code
|
||||
|
||||
###### Returns
|
||||
|
||||
Whether it matches (`boolean`).
|
||||
|
||||
## Types
|
||||
|
||||
This package is fully typed with [TypeScript][].
|
||||
It exports no additional types.
|
||||
|
||||
## Compatibility
|
||||
|
||||
Projects maintained by the unified collective are compatible with all maintained
|
||||
versions of Node.js.
|
||||
As of now, that is Node.js 16+.
|
||||
Our projects sometimes work with older versions, but this is not guaranteed.
|
||||
|
||||
This package works with `micromark` version 3+.
|
||||
|
||||
## Security
|
||||
|
||||
This package is safe.
|
||||
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
|
||||
submit a security report.
|
||||
|
||||
## Contribute
|
||||
|
||||
See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
|
||||
to get started.
|
||||
See [`support.md`][support] for ways to get help.
|
||||
|
||||
This project has a [code of conduct][coc].
|
||||
By interacting with this repository, organisation, or community you agree to
|
||||
abide by its terms.
|
||||
|
||||
## License
|
||||
|
||||
[MIT][license] © [Titus Wormer][author]
|
||||
|
||||
<!-- Definitions -->
|
||||
|
||||
[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg
|
||||
|
||||
[build]: https://github.com/micromark/micromark/actions
|
||||
|
||||
[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg
|
||||
|
||||
[coverage]: https://codecov.io/github/micromark/micromark
|
||||
|
||||
[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-character.svg
|
||||
|
||||
[downloads]: https://www.npmjs.com/package/micromark-util-character
|
||||
|
||||
[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-character
|
||||
|
||||
[bundle-size]: https://bundlejs.com/?q=micromark-util-character
|
||||
|
||||
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
|
||||
|
||||
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
|
||||
|
||||
[opencollective]: https://opencollective.com/unified
|
||||
|
||||
[npm]: https://docs.npmjs.com/cli/install
|
||||
|
||||
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
|
||||
|
||||
[esmsh]: https://esm.sh
|
||||
|
||||
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
|
||||
|
||||
[chat]: https://github.com/micromark/micromark/discussions
|
||||
|
||||
[license]: https://github.com/micromark/micromark/blob/main/license
|
||||
|
||||
[author]: https://wooorm.com
|
||||
|
||||
[health]: https://github.com/micromark/.github
|
||||
|
||||
[securitymd]: https://github.com/micromark/.github/blob/main/security.md
|
||||
|
||||
[contributing]: https://github.com/micromark/.github/blob/main/contributing.md
|
||||
|
||||
[support]: https://github.com/micromark/.github/blob/main/support.md
|
||||
|
||||
[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
|
||||
|
||||
[typescript]: https://www.typescriptlang.org
|
||||
|
||||
[micromark]: https://github.com/micromark/micromark
|
||||
|
||||
[code]: https://github.com/micromark/micromark#preprocess
|
||||
|
||||
[api-ascii-alpha]: #asciialphacode
|
||||
|
||||
[api-ascii-alphanumeric]: #asciialphanumericcode
|
||||
|
||||
[api-ascii-atext]: #asciiatextcode
|
||||
|
||||
[api-ascii-control]: #asciicontrolcode
|
||||
|
||||
[api-ascii-digit]: #asciidigitcode
|
||||
|
||||
[api-ascii-hex-digit]: #asciihexdigitcode
|
||||
|
||||
[api-ascii-punctuation]: #asciipunctuationcode
|
||||
|
||||
[api-markdown-line-ending]: #markdownlineendingcode
|
||||
|
||||
[api-markdown-line-ending-or-space]: #markdownlineendingorspacecode
|
||||
|
||||
[api-markdown-space]: #markdownspacecode
|
||||
|
||||
[api-unicode-punctuation]: #unicodepunctuationcode
|
||||
|
||||
[api-unicode-whitespace]: #unicodewhitespacecode
|
||||
Loading…
Add table
Add a link
Reference in a new issue