diff --git a/admin/js/pagedown.js b/admin/js/pagedown.js index 49c49236..fa398f12 100644 --- a/admin/js/pagedown.js +++ b/admin/js/pagedown.js @@ -1086,7 +1086,16 @@ else } function _DoItalicsAndBold(text) { + // must go first: + text = text.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g, + "$2"); + text = text.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g, + "$2"); + + return text; + +/* // must go first: text = text.replace(/([\W_]|^)(\*\*|__)(?=\S)([^\r]*?\S[\*_]*)\2([\W_]|$)/g, "$1$3$4"); @@ -1095,6 +1104,7 @@ else "$1$3$4"); return text; +*/ } function _DoBlockQuotes(text) {