fixed: italics and bold in a * list
This commit is contained in:
parent
3e211831d0
commit
5fe950ce8c
21
main.js
21
main.js
|
@ -2099,6 +2099,23 @@ function applycolors()
|
|||
line = "<b>" + line + "</b>";
|
||||
}
|
||||
|
||||
// bold and italics
|
||||
var temp = line;
|
||||
if (line.startsWith("* "))
|
||||
{
|
||||
temp = line.substring(2);
|
||||
}
|
||||
temp = temp.replace(/\*\*([^\*]*)\*\*/g, "<b>**$1**</b>");
|
||||
temp = temp.replace(/\*([^\*]*)\*/g, "<em>*$1*</em>");
|
||||
if (line.startsWith("* "))
|
||||
{
|
||||
line = "* " + temp;
|
||||
}
|
||||
else
|
||||
{
|
||||
line = temp;
|
||||
}
|
||||
|
||||
// lists
|
||||
markerslist.forEach(marker =>
|
||||
{
|
||||
|
@ -2151,10 +2168,6 @@ function applycolors()
|
|||
// internal links
|
||||
line = line.replace(/(\[\[.*\]\])/g, "<u><span style='cursor:pointer'>$1</span></u>");
|
||||
|
||||
// bold and italics
|
||||
line = line.replace(/\*\*([^\*]*)\*\*/g, "<b>**$1**</b>");
|
||||
line = line.replace(/\*([^\*]*)\*/g, "<em>*$1*</em>");
|
||||
|
||||
// comments
|
||||
line = line.replace(/<\!/g, "<span style='color:lightgrey'><!");
|
||||
line = line.replace(/\-\->/g, "--></span>");
|
||||
|
|
Loading…
Reference in New Issue