Switch to SQLite-backed session storage, cleanup third-party dependencies, and refine CSP for restricted external assets.
CI / check (22) (push) Failing after 4m51s
CI / check (24) (push) Failing after 3h11m30s

This commit is contained in:
2026-10-12 23:19:36 +02:00
parent 7723125c93
commit dd23a19ed2
15 changed files with 164 additions and 169 deletions
+20
View File
@@ -0,0 +1,20 @@
/* Local, pinned Markdown renderer compatible with the marked.parse API used by the chat UI. */
(function () {
const escape = value => String(value).replace(/[&<>"']/g, character => ({"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#39;"}[character]));
const inline = value => escape(value)
.replace(/`([^`]+)`/g, "<code>$1</code>")
.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>")
.replace(/__([^_]+)__/g, "<strong>$1</strong>")
.replace(/\*([^*]+)\*/g, "<em>$1</em>")
.replace(/_([^_]+)_/g, "<em>$1</em>")
.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g, '<a href="$2" rel="noreferrer noopener">$1</a>');
window.marked = {parse(markdown) {
return String(markdown || "").split(/\n{2,}/).map(block => {
const lines = block.split("\n");
if (/^### /.test(lines[0])) return `<h3>${inline(lines[0].slice(4))}</h3>`;
if (/^## /.test(lines[0])) return `<h2>${inline(lines[0].slice(3))}</h2>`;
if (/^# /.test(lines[0])) return `<h1>${inline(lines[0].slice(2))}</h1>`;
return `<p>${lines.map(inline).join("<br>")}</p>`;
}).join("");
}};
}());