From 59a5a98e1c5156ce1ab3e8a4f191f3b9ad9191b3 Mon Sep 17 00:00:00 2001 From: Gao Chao Date: Thu, 24 Jul 2014 19:01:30 +0800 Subject: [PATCH] FIX: inner block string like a_someting_ will be replaced by em or strong --- src/showdown.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/showdown.js b/src/showdown.js index b488bad..d091364 100644 --- a/src/showdown.js +++ b/src/showdown.js @@ -1130,10 +1130,10 @@ var _EncodeCode = function(text) { var _DoItalicsAndBold = function(text) { // must go first: - text = text.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g, + text = text.replace(/^(\*\*|__)(?=\S)([^\r]*?\S[*_]*)$\1/g, "$2"); - text = text.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g, + text = text.replace(/^(\*|_)(?=\S)([^\r]*?\S)$\1/g, "$2"); return text;