提交 ec330f09 编写于 作者: M mechdude 提交者: ULIVZ

fix: multiple markdown tokens in header text (#564)

上级 5afff6fe
......@@ -13,9 +13,9 @@ const unescapeHtml = html => String(html)
.replace(/>/g, '>')
const removeMarkdownToken = str => String(str)
.replace(/\[(.*)\]\(.*\)/, '$1') // []()
.replace(/(`|\*\*|\*|_)(.*[^\\])\1/, '$2') // `{t}` | *{t}* | **{t}** | _{t}_
.replace(/(\\)(\*|_|`)/g, '$2') // remove escape char '\'
.replace(/\[(.*)\]\(.*\)/, '$1') // []()
.replace(/(`|\*{1,3}|_)(.*?[^\\])\1/g, '$2') // `{t}` | *{t}* | **{t}** | ***{t}*** | _{t}_
.replace(/(\\)(\*|_|`)/g, '$2') // remove escape char '\'
exports.removeTailHtml = (str) => {
return String(str).replace(/<.*>\s*$/g, '')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册