diff --git a/main.js b/main.js index 5892139..3d0fe9d 100644 --- a/main.js +++ b/main.js @@ -2099,6 +2099,23 @@ function applycolors() line = "" + line + ""; } + // bold and italics + var temp = line; + if (line.startsWith("* ")) + { + temp = line.substring(2); + } + temp = temp.replace(/\*\*([^\*]*)\*\*/g, "**$1**"); + temp = temp.replace(/\*([^\*]*)\*/g, "*$1*"); + if (line.startsWith("* ")) + { + line = "* " + temp; + } + else + { + line = temp; + } + // lists markerslist.forEach(marker => { @@ -2151,10 +2168,6 @@ function applycolors() // internal links line = line.replace(/(\[\[.*\]\])/g, "$1"); - // bold and italics - line = line.replace(/\*\*([^\*]*)\*\*/g, "**$1**"); - line = line.replace(/\*([^\*]*)\*/g, "*$1*"); - // comments line = line.replace(/<\!/g, "<!"); line = line.replace(/\-\->/g, "-->");