Embedded in italics must add a space in front of the first asterisk and add a space after the second asterisk.

This commit is contained in:
liudng 2014-12-20 17:40:19 +08:00
parent 053288f2fe
commit fe7ba8e0d4

View File

@ -1133,6 +1133,9 @@ var _DoItalicsAndBold = function(text) {
text = text.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,
"<strong>$2</strong>");
text = text.replace(/^(\*|_)(?=\S)([^\r]*?\S)\1/g,
"<em>$2</em>");
text = text.replace(/ (\*|_)(?=\S)([^\r]*?\S)\1 /g,
"<em>$2</em>");