refactoring of cmaps, widgets, etc.
This commit is contained in:
@@ -49,6 +49,23 @@ test("WikiWords use page and CMap catalogues without expanding protected text",
|
||||
"[Homeopathie Wiki](#/homeopathie) en [Architectuur Kaart](#cmap/architectuur), maar `NieuwePagina` niet.");
|
||||
});
|
||||
|
||||
test("an exclamation mark renders a WikiWord literally without becoming visible", () => {
|
||||
const pages = [
|
||||
{ slug: "homeopathie", namespace: "", pageSlug: "homeopathie", title: "Homeopathie Wiki" }
|
||||
];
|
||||
const conceptMaps = [{ slug: "architectuur", title: "Architectuur Kaart" }];
|
||||
const markdown = "!HomeopathieWiki en !NieuwePagina en !cmap:ArchitectuurKaart.";
|
||||
const expanded = expandWikiMentions(markdown, pages, [], conceptMaps);
|
||||
assert.equal(expanded,
|
||||
"HomeopathieWiki en NieuwePagina en cmap:ArchitectuurKaart.");
|
||||
assert.equal(expandWikiMentions(expanded, pages, [], conceptMaps), expanded);
|
||||
});
|
||||
|
||||
test("the WikiWord escape remains literal in protected Markdown", () => {
|
||||
const markdown = "`!NieuwePagina` en [!NieuwePagina](https://example.com)";
|
||||
assert.equal(expandWikiMentions(markdown, [], [], []), markdown);
|
||||
});
|
||||
|
||||
test("ambiguous CMap mentions are not resolved", () => {
|
||||
const conceptMaps = [
|
||||
{ slug: "first", title: "Zelfde Kaart" },
|
||||
|
||||
Reference in New Issue
Block a user