Docs: slugify.paths replaces whitespace with - not _ (#2474)

Minor documentation fix: when `slugify.paths` is set to `"safe"`, whitespaces are replaced with a hyphen, not an underscore.
This commit is contained in:
Nathan Friedly 2024-04-18 07:12:38 -04:00 committed by GitHub
parent 0ec6a6c973
commit 55e1844c1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,7 +6,7 @@ weight = 50
## Heading id and anchor insertion
While rendering the Markdown content, a unique id will automatically be assigned to each heading.
This id is created by converting the heading text to a [slug](https://en.wikipedia.org/wiki/Semantic_URL#Slug) if `slugify.anchors` is set to `"on"` (the default).
If `slugify.paths` is set to `"safe"`, whitespaces are replaced by `_` and the following characters are stripped: `#`, `%`, `<`, `>`, `[`, `]`, `(`, `)`, \`, `^`, `{`, `|`, `}`.
If `slugify.paths` is set to `"safe"`, whitespaces are replaced by `-` and the following characters are stripped: `#`, `%`, `<`, `>`, `[`, `]`, `(`, `)`, \`, `^`, `{`, `|`, `}`.
If `slugify.paths` is set to `"off"`, no modifications are made, and you may be left with nominally illegal ids.
A number is appended at the end if the slug already exists for that article.
For example: