Skip to content

Commit

Permalink
don't capture the character after the bold/italic end (http://meta.st…
Browse files Browse the repository at this point in the history
  • Loading branch information
balpha committed Apr 11, 2014
1 parent 4c91a7a commit 2b260ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Markdown.Converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1079,11 +1079,11 @@ else
function _DoItalicsAndBold(text) {

// <strong> must go first:
text = text.replace(/([\W_]|^)(\*\*|__)(?=\S)([^\r]*?\S[\*_]*)\2([\W_]|$)/g,
"$1<strong>$3</strong>$4");
text = text.replace(/([\W_]|^)(\*\*|__)(?=\S)([^\r]*?\S[\*_]*)\2(?=[\W_]|$)/g,
"$1<strong>$3</strong>");

text = text.replace(/([\W_]|^)(\*|_)(?=\S)([^\r\*_]*?\S)\2([\W_]|$)/g,
"$1<em>$3</em>$4");
text = text.replace(/([\W_]|^)(\*|_)(?=\S)([^\r\*_]*?\S)\2(?=[\W_]|$)/g,
"$1<em>$3</em>");

return text;
}
Expand Down

0 comments on commit 2b260ea

Please sign in to comment.