Skip to content

Commit ec330f0

Browse files
halaaroulivz
authored andcommitted
fix: multiple markdown tokens in header text (#564)
1 parent 5afff6f commit ec330f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/util/parseHeaders.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ const unescapeHtml = html => String(html)
1313
.replace(/>/g, '>')
1414

1515
const removeMarkdownToken = str => String(str)
16-
.replace(/\[(.*)\]\(.*\)/, '$1') // []()
17-
.replace(/(`|\*\*|\*|_)(.*[^\\])\1/, '$2') // `{t}` | *{t}* | **{t}** | _{t}_
18-
.replace(/(\\)(\*|_|`)/g, '$2') // remove escape char '\'
16+
.replace(/\[(.*)\]\(.*\)/, '$1') // []()
17+
.replace(/(`|\*{1,3}|_)(.*?[^\\])\1/g, '$2') // `{t}` | *{t}* | **{t}** | ***{t}*** | _{t}_
18+
.replace(/(\\)(\*|_|`)/g, '$2') // remove escape char '\'
1919

2020
exports.removeTailHtml = (str) => {
2121
return String(str).replace(/<.*>\s*$/g, '')

0 commit comments

Comments
 (0)