zetl build renders multi-word inline/predicate wikilinks as dead links (raw-title href) despite resolving in graph & check #66
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
zetl buildrenders multi-word inline/predicate wikilinks as dead links, emitting anhrefbuilt from the raw page title (e.g.Gender-Based%20Violence/index.html) instead of the resolved slug path (concepts/gender-based-violence/index.html). The links carryclass="link-error wikilink wikilink-dead". This happens even though:zetl checkreports 0 dead links,zetl links/zetl backlinksresolve the same links correctly,So the graph resolver and the inline HTML renderer disagree. On a deployed static site every natural-language wikilink in prose and every
predicate::[[Title Case Link]]is a broken link.Affects zetl 0.9.0 (HEAD
a0fab3b).Root cause
src/web/markdown.rs,replace_wikilinks_in_segment:slug_mapis keyed bypage_name(the kebab slug, e.g.gender-based-violence; seebuild_slug_mapinsrc/web/mod.rs:290). The lookup compares the raw, un-slugified wikilink target against those keys with onlyeq_ignore_ascii_case— it never converts spaces to hyphens (or otherwise slugifies). So:The match fails, control falls to the dead-link branch (
src/web/markdown.rs:581, also 795/814), and the href is built fromurlencoding(page)— the raw title — givingGender-Based%20Violence/index.html.Single-token / already-kebab links (
[[concept-map]]) match and resolve fine, which is why the bug only shows on multi-word titles.The graph resolver /
zetl checkpath slugifies the target before resolving, which is why it reports these same links as live. The inline renderer needs the same normalization.Reproduction
Vault with
concepts/gender-based-violence.mdand a page that links to it by natural title:Observed in the
anti-violence-techvault: e.g.dist/research/datafication-of-metoo/index.htmlemitshref="../../Apps%20Against%20Abuse%20Challenge/index.html",href="../../Gender-Based%20Violence/index.html", etc., while the nav on the same page correctly links../../concepts/gender-based-violence/index.html.Expected
Inline and predicate wikilinks should resolve to the same slug paths the graph resolver / nav use:
[[Gender-Based Violence]]→…/concepts/gender-based-violence/index.htmlwithclass="link link-primary wikilink".Suggested fix
Normalize
pagewith the same slugification the graph/scanner uses before looking it up inslug_map(rather than
eq_ignore_ascii_caseon the raw target) inreplace_wikilinks_in_segment(
src/web/markdown.rs). Add a regression test alongside the existingwikilink_*tests for amulti-word, space-containing target.
Impact
Every static build (
zetl build) of a vault that uses natural-language multi-word page titles in inlineprose links or
predicate::[[...]]links produces broken navigation — the core wikilink feature is brokenfor deployed sites, while
zetl checkgives a false all-clear.Fixed in zetl 0.9.1 (verified earlier); confirmed in 0.9.2 build/deploy. Multi-word inline/predicate wikilinks now resolve to slugs.