fixed: menu below colors

added: md comments in colors
This commit is contained in:
quenousimporte 2023-09-23 22:51:59 +02:00
parent 5d5456c5ac
commit 88e1a7c60f
2 changed files with 15 additions and 0 deletions

14
main.js
View File

@ -2026,6 +2026,15 @@ function save()
}
}
function escapeHtml(unsafe) {
return unsafe
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
}
function applycolors()
{
if (!settings.colors)
@ -2039,6 +2048,7 @@ function applycolors()
var result = [];
lines.every( (line, i) =>
{
line = escapeHtml(line);
if (line.startsWith("#"))
{
line = line.replace(/(#*)/g, "<span style='color:" + settings.accentcolor + "'>$1</span>");
@ -2076,6 +2086,10 @@ function applycolors()
line = line.replace(/(\[\[.*\]\])/g, "<u><span style='cursor:pointer'>$1</span></u>");
line = line.replace(/(\*\*.*\*\*)/g, "<b>$1</b>");
line = line.replace(/(\*.*\*)/g, "<em>$1</em>");
line = line.replace(/&lt;\!/g, "<span style='color:lightgrey'>&lt;!");
line = line.replace(/\-\-&gt;/g, "--></span>");
result.push(line);
return true;

View File

@ -119,6 +119,7 @@ body::-webkit-scrollbar-thumb {
opacity: 1;
width: 90%;
color: black;
z-index: 2;
}
/* authent */