Spaces:
Runtime error
Runtime error
Update templates/index.html
Browse files930 unmodified lines9319329339349359369372 unmodified lines940941942943944945946947930 unmodified lines}function nl2br(s) { return esc(s).replace(/\n/g, "<br>"); }function renderInlineMarkdown(s) {let out = esc(String(s || ""));out = out.replace(/`([^`]+)`/g, "<code>$1</code>");out = out.replace(/\*\*\*([^*]+)\*\*\*/g, "<strong><em>$1</em></strong>");out = out.replace(/___([^_]+)___/g, "<strong><em>$1</em></strong>");2 unmodified linesout = out.replace(/\*([^*\s][^*]*[^*\s]|\S)\*/g, "<em>$1</em>");out = out.replace(/_([^_\s][^_]*[^_\s]|\S)_/g, "<em>$1</em>");out = out.replace(/~~([^~]+)~~/g, "<s>$1</s>");out = out.replace(/!\[([^\]]*)\]\((https?:\/\/[^\s)]+)\)/g, '<img class="md-img" src="$2" alt="$1" loading="lazy">');out = out.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g, '<a href="$2" target="_blank" rel="noreferrer">$1</a>');return out;}function renderMarkdown(md) {930 unmodified lines9319329339349359369379389399409419429439449459469479489499509512 unmodified lines954955956957958959960930 unmodified lines}function nl2br(s) { return esc(s).replace(/\n/g, "<br>"); }function renderInlineMarkdown(s) {// Extract images and links before escaping so URLs are never mangled by italic/bold regexesconst tokens = [];const raw = String(s || "").replace(/!\[([^\]]*)\]\((https?:\/\/[^\s)]+)\)|\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,(match, imgAlt, imgSrc, linkText, linkHref) => {const idx = tokens.length;if (imgSrc !== undefined) {tokens.push(`<img class="md-img" src="${imgSrc}" alt="${esc(imgAlt)}" loading="lazy">`);} else {tokens.push(`<a href="${linkHref}" target="_blank" rel="noreferrer">${esc(linkText)}</a>`);}return `\x00${idx}\x00`;});let out = esc(raw);out = out.replace(/`([^`]+)`/g, "<code>$1</code>");out = out.replace(/\*\*\*([^*]+)\*\*\*/g, "<strong><em>$1</em></strong>");out = out.replace(/___([^_]+)___/g, "<strong><em>$1</em></strong>");2 unmodified linesout = out.replace(/\*([^*\s][^*]*[^*\s]|\S)\*/g, "<em>$1</em>");out = out.replace(/_([^_\s][^_]*[^_\s]|\S)_/g, "<em>$1</em>");out = out.replace(/~~([^~]+)~~/g, "<s>$1</s>");out = out.replace(/\x00(\d+)\x00/g, (_, i) => tokens[Number(i)]);return out;}function renderMarkdown(md) {
templates/index.html+16-3