FIX: inner block string like a_someting_ will be replaced by em or strong

This commit is contained in:
Gao Chao 2014-07-24 19:01:30 +08:00
parent 2e102c72b2
commit 59a5a98e1c

View File

@ -1130,10 +1130,10 @@ var _EncodeCode = function(text) {
var _DoItalicsAndBold = function(text) { var _DoItalicsAndBold = function(text) {
// <strong> must go first: // <strong> must go first:
text = text.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g, text = text.replace(/^(\*\*|__)(?=\S)([^\r]*?\S[*_]*)$\1/g,
"<strong>$2</strong>"); "<strong>$2</strong>");
text = text.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g, text = text.replace(/^(\*|_)(?=\S)([^\r]*?\S)$\1/g,
"<em>$2</em>"); "<em>$2</em>");
return text; return text;