Skip to content

Commit

Permalink
fix: reserve '*' and '_' when detecting escape char '\' (close: #544).
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Jun 4, 2018
1 parent e052c2a commit 4503cfc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/util/parseHeaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ const removeMarkdownToken = str => String(str)
.replace(/`(.*)`/, '$1') // ``
.replace(/\[(.*)\]\(.*\)/, '$1') // []()
.replace(/\*\*(.*)\*\*/, '$1') // **
.replace(/\*(.*)\*/, '$1') // *
.replace(/_(.*)_/, '$1') // _
.replace(/\*(.*[^\\])\*/, '$1') // *
.replace(/_(.*[^\\])_/g, '$1') // _ _
.replace(/(\\)(\*|_)/g, '$2') // remove escaped char '\'

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

0 comments on commit 4503cfc

Please sign in to comment.