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() function applycolors()
{ {
if (!settings.colors) if (!settings.colors)
@ -2039,6 +2048,7 @@ function applycolors()
var result = []; var result = [];
lines.every( (line, i) => lines.every( (line, i) =>
{ {
line = escapeHtml(line);
if (line.startsWith("#")) if (line.startsWith("#"))
{ {
line = line.replace(/(#*)/g, "<span style='color:" + settings.accentcolor + "'>$1</span>"); 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, "<u><span style='cursor:pointer'>$1</span></u>");
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>");
line = line.replace(/&lt;\!/g, "<span style='color:lightgrey'>&lt;!");
line = line.replace(/\-\-&gt;/g, "--></span>");
result.push(line); result.push(line);
return true; return true;

View File

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