Generate the same heading anchor that the renderer emits downstream.
rehype-slug delegates to github-slugger (the GitHub heading slug algorithm), and rehype-sanitize then prefixes every emitted ID with HEADING_ID_PREFIX as a DOM-clobbering mitigation. We mirror both steps here so the Reader Intelligence Guide's #anchor links resolve to the rendered IDs across punctuation, Unicode and duplicate-heading cases.
A fresh GithubSlugger instance is used per call so the function is stateless โ duplicate-heading disambiguation is not relevant for the Reader Intelligence Guide because each guide entry maps to a unique canonical artifact section title.
Generate the same heading anchor that the renderer emits downstream.
rehype-slugdelegates togithub-slugger(the GitHub heading slug algorithm), andrehype-sanitizethen prefixes every emitted ID with HEADING_ID_PREFIX as a DOM-clobbering mitigation. We mirror both steps here so the Reader Intelligence Guide's#anchorlinks resolve to the rendered IDs across punctuation, Unicode and duplicate-heading cases.A fresh
GithubSluggerinstance is used per call so the function is stateless โ duplicate-heading disambiguation is not relevant for the Reader Intelligence Guide because each guide entry maps to a unique canonical artifact section title.