Make bare category/node topic cross-references clickable

#1
by thomwolf HF Staff - opened
RL+LLM Wiki org

Topic articles cite sibling topics as bare category/node code spans (e.g. foundations/policy-gradient-methods). These now render as links to that topic's page when it exists โ€” complementing rewriteInternalLinks, which already handles markdown-link cross-refs (this href is a #/ route, so that pass skips it).

Implemented as a marked codespan renderer in setupMarked. Key detail: marked@13 passes codespan the already-HTML-escaped code text as a plain string (the {text} token arg is a marked-v16 API), so it is read directly and not re-escaped โ€” a prior attempt read tok.text and silently produced zero links. Only linkifies when the target topics//.md is in state.pages, so planned-but-unwritten refs and non-topic code spans (uppercase, no slash) stay plain.

Verified in-browser against the live dataset: 18 refs link on the overview page, zero false positives, clicking navigates to the target topic. Adds a .xref chip style (accent tint + hover, dark-theme aware).

lvwerra changed pull request status to merged

Sign up or log in to comment