From 521601d20bef4c59588c670e42812d36c3e59d02 Mon Sep 17 00:00:00 2001 From: artiely <1119696785@qq.com> Date: Mon, 13 Jun 2022 16:57:51 +0800 Subject: [PATCH] chore: typo (#783) --- src/node/utils/parseHeader.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/utils/parseHeader.ts b/src/node/utils/parseHeader.ts index b303e222..35c2732c 100644 --- a/src/node/utils/parseHeader.ts +++ b/src/node/utils/parseHeader.ts @@ -32,7 +32,7 @@ const removeMarkdownTokens = (str: string) => .replace(/(`|\*{1,3}|_)(.*?[^\\])\1/g, '$2') // `{t}` | *{t}* | **{t}** | ***{t}*** | _{t}_ .replace(/(\\)(\*|_|`|\!|<|\$)/g, '$2') // remove escape char '\' -const remvoeCustomAnchor = (str: string) => +const removeCustomAnchor = (str: string) => str.replace(/\{#([a-z0-9\-_]+?)\}\s*$/, '') // {#custom-header} const trim = (str: string) => str.trim() @@ -57,7 +57,7 @@ const compose = (...processors: ((str: string) => string)[]) => { export const parseHeader = compose( unescapeHtml, parseEmojis, - remvoeCustomAnchor, + removeCustomAnchor, removeMarkdownTokens, trim )