From 88e1a7c60f04d0fa48cb4234a80fcc8f9221b214 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Sat, 23 Sep 2023 22:51:59 +0200 Subject: [PATCH] fixed: menu below colors added: md comments in colors --- main.js | 14 ++++++++++++++ style.css | 1 + 2 files changed, 15 insertions(+) diff --git a/main.js b/main.js index 32fc338..e035664 100644 --- a/main.js +++ b/main.js @@ -2026,6 +2026,15 @@ function save() } } +function escapeHtml(unsafe) { + return unsafe + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); + } + 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, "$1"); @@ -2076,6 +2086,10 @@ function applycolors() line = line.replace(/(\[\[.*\]\])/g, "$1"); line = line.replace(/(\*\*.*\*\*)/g, "$1"); line = line.replace(/(\*.*\*)/g, "$1"); + + line = line.replace(/<\!/g, "<!"); + line = line.replace(/\-\->/g, "-->"); + result.push(line); return true; diff --git a/style.css b/style.css index cf49c2d..11004e7 100644 --- a/style.css +++ b/style.css @@ -119,6 +119,7 @@ body::-webkit-scrollbar-thumb { opacity: 1; width: 90%; color: black; + z-index: 2; } /* authent */