diff options
author | 2021-03-16 12:37:45 -0600 | |
---|---|---|
committer | 2021-03-16 12:37:45 -0600 | |
commit | 8c45c4a8567e31a10ae954fa11a0f3f1f94fd89c (patch) | |
tree | e526f67e93ed5a7fcf9237c2d30ec536a4a96d7b /src/markdown-encode.ts | |
parent | 1f5c7c791fe3595f4c775192ffc6b6a15efb71a1 (diff) | |
download | astro-8c45c4a8567e31a10ae954fa11a0f3f1f94fd89c.tar.gz astro-8c45c4a8567e31a10ae954fa11a0f3f1f94fd89c.tar.zst astro-8c45c4a8567e31a10ae954fa11a0f3f1f94fd89c.zip |
Annoying Lint PR™ (#3)
* Add Prettier + ESLint
* Format files
Diffstat (limited to 'src/markdown-encode.ts')
-rw-r--r-- | src/markdown-encode.ts | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/markdown-encode.ts b/src/markdown-encode.ts index 0719aaa32..173c63fde 100644 --- a/src/markdown-encode.ts +++ b/src/markdown-encode.ts @@ -6,14 +6,14 @@ const characterReferences = { '<': 'lt', '>': 'gt', '{': 'lbrace', - '}': 'rbrace' + '}': 'rbrace', }; type EncodedChars = '"' | '&' | '<' | '>' | '{' | '}'; function encode(value: string): string { return value.replace(/["&<>{}]/g, (raw: string) => { - return '&' + characterReferences[raw as EncodedChars] + ';' + return '&' + characterReferences[raw as EncodedChars] + ';'; }); } @@ -21,14 +21,12 @@ const plugin: HtmlExtension = { exit: { codeFlowValue() { const token: Token = arguments[0]; - const serialize = this.sliceSerialize as unknown as (t: Token) => string; - const raw = this.raw as unknown as (s: string) => void; + const serialize = (this.sliceSerialize as unknown) as (t: Token) => string; + const raw = (this.raw as unknown) as (s: string) => void; const value = serialize(token); raw(encode(value)); - } - } + }, + }, }; -export { - plugin as default -};
\ No newline at end of file +export { plugin as default }; |