Skip to content

Commit

Permalink
fix: multiple markdown tokens in header text (#564)
Browse files Browse the repository at this point in the history
  • Loading branch information
halaaro authored and ulivz committed Jun 20, 2018
1 parent 5afff6f commit ec330f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/util/parseHeaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, '')
Expand Down

0 comments on commit ec330f0

Please sign in to comment.