Closed aegatlin closed 1 year ago
hmm, I actually just realized #
should probably be treated as a one-time occurrence and not something that should be allowed repeatedly in a slug... 🤔
We could still keep this and modify the allowSet
to exclude #
, and then address that separately. Let me know what you think 👍
and then address that separately
Address it how?
what I'm doing in my workflow to slugify urls is basically...
const [a, b] = s.split('#')
const slug = `${slugify(a)}#${slugify(b)}`
But, this depends on the extent to which you want slugify === urlify.
I think if the user sets #
as a preserved, it's up to them to ensure it works in a URL. I don't think we should have any special handling.
Sounds good to me. I think the PR is ready to review, then. 😀👍
Fixes #55
I wanted to preserve the HTML fragment,
#
, in my use-case for slugify. I saw #55 and thought I'd kick off the PR for it.