idGenerator
Handler for converting some incoming text (fairly unconstrained) into a final string value that should be used as an ID for a URL fragment.
By default, this simply only accepts letters and digits and converts everything else to hyphens (while removing any duplicate neighboring hyphens), producing a lowercase value.
However, if your project needs more fine-grained control over the generated names, you can set this callback however you see fit.
If you override this callback, you may want to check with https://www.rfc-editor.org/rfc/rfc3986 to ensure the ID generated is valid.