Update documentation system: improve structure, search, and editor

This commit is contained in:
dev
2026-11-01 14:44:05 +03:00
parent 9a509fa742
commit 773e092253
6 changed files with 40 additions and 30 deletions
+3 -4
View File
@@ -27,12 +27,11 @@
return `\u0000${codes.length - 1}\u0000`;
});
text = esc(text);
text = text.replace(/!\[([^\]]*)\]\(([^)\s]+)(?:\s+"([^"]*)")?\)/g, (m, alt, src, title) => {
text = text.replace(/!\[([^\]]*)\]\(([^)\s]+)\)/g, (m, alt, src) => {
const url = safeUrl(src.replace(/&/g, '&'));
if (!url) return alt;
const t = title ? title.replace(/&/g, '&') : '';
const img = `<img src="${esc(thumbUrl(url))}" data-img="${esc(url)}" alt="${esc(alt)}"${t ? ` title="${esc(t)}"` : ''} loading="lazy">`;
if (t) return `<figure class="md-figure">${img}<figcaption>${esc(t)}</figcaption></figure>`;
const img = `<img src="${esc(thumbUrl(url))}" data-img="${esc(url)}" alt="${esc(alt)}" loading="lazy">`;
if (alt) return `<figure class="md-figure">${img}<figcaption>${esc(alt)}</figcaption></figure>`;
return img;
});
text = text.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g, (m, label, href) => {