@ende/markdown/slug

ende add jsr:@ende/markdown

Version 2026.10.18 on JSR.

Exports

  • slug — Turns text into a heading id the way GitHub does (with the algorithm of github-slugger): it lowercases the text, removes everything except letters, marks, numbers, connector punctuation such as `_`, hyphens and spaces, and turns each space into a hyphen. Runs of spaces and hyphens aren't collapsed, and the result isn't trimmed, so ids match GitHub's anchors.