small changes

This commit is contained in:
2026-09-07 22:41:33 +02:00
parent 32c75f8ff1
commit d351b8e3c8
7 changed files with 250 additions and 11 deletions
+8
View File
@@ -9,6 +9,7 @@ import {
expandTodoMarkup,
expandWikiMentions,
extractCmapEmbeds,
normalizeMarkdownLinkDestinations,
protectCamelCaseWikiWords,
restoreCmapEmbeds
} from "../static/js/wiki/markdown.js";
@@ -39,6 +40,13 @@ test("explicit namespaced links become internal routes outside code", () => {
"[Page](#/notes%3Aroadmap)\n[CMap](#cmap/architecture)\n```\n[Code](notes:keep)\n```");
});
test("link destinations with spaces are encoded without changing code", () => {
const markdown = "* [DOC](/uploads/review-zuidas-2026:appreciatie/1788796826-35348-Review ZuidasDok - Hans Dijkema - Beschouwing v3.docx)\n`[code](/uploads/page/file name.txt)`\n```\n[code](/uploads/page/file name.txt)\n```";
assert.equal(
normalizeMarkdownLinkDestinations(markdown),
"* [DOC](/uploads/review-zuidas-2026:appreciatie/1788796826-35348-Review%20ZuidasDok%20-%20Hans%20Dijkema%20-%20Beschouwing%20v3.docx)\n`[code](/uploads/page/file name.txt)`\n```\n[code](/uploads/page/file name.txt)\n```");
});
test("WikiWords use page and CMap catalogues without expanding protected text", () => {
const pages = [
{ slug: "homeopathie", namespace: "", pageSlug: "homeopathie", title: "Homeopathie Wiki" }