fix(colors): bold and italics
improve(colors): consider all list markers
This commit is contained in:
parent
34a7ccfbbd
commit
b73d152aeb
16
main.js
16
main.js
|
@ -2104,15 +2104,13 @@ function applycolors()
|
||||||
}
|
}
|
||||||
|
|
||||||
// lists
|
// lists
|
||||||
if (line.startsWith("* "))
|
markerslist.forEach(marker =>
|
||||||
{
|
{
|
||||||
line = line.replace(/(\* )/g, "<span style='color:" + settings.accentcolor + "'>$1</span>");
|
if (line.startsWith(marker))
|
||||||
}
|
{
|
||||||
else if (line.startsWith("- "))
|
line = line.replace(marker, "<span style='color:" + settings.accentcolor + "'>" + marker + "</span>");
|
||||||
{
|
}
|
||||||
line = line.replace(/(\- )/g, "<span style='color:" + settings.accentcolor + "'>$1</span>");
|
});
|
||||||
}
|
|
||||||
// todo: use markerslist
|
|
||||||
|
|
||||||
// md header
|
// md header
|
||||||
if (i == 0 && line == "---")
|
if (i == 0 && line == "---")
|
||||||
|
@ -2153,7 +2151,7 @@ function applycolors()
|
||||||
|
|
||||||
// bold and italics
|
// bold and italics
|
||||||
line = line.replace(/(\*\*.*\*\*)/g, "<b>$1</b>");
|
line = line.replace(/(\*\*.*\*\*)/g, "<b>$1</b>");
|
||||||
line = line.replace(/(\*.*\*)/g, "<em>$1</em>");
|
line = line.replace(/(^\*\*.*\*)/g, "<em>$1</em>");
|
||||||
|
|
||||||
// comments
|
// comments
|
||||||
line = line.replace(/<\!/g, "<span style='color:lightgrey'><!");
|
line = line.replace(/<\!/g, "<span style='color:lightgrey'><!");
|
||||||
|
|
Loading…
Reference in New Issue