New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why not support a pluggable option.slug
function (or options.slugger
implementation)?
#17
Comments
Hi. Did you see the existing issues? https://github.com/rehypejs/rehype-slug/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aclosed |
This comment has been minimized.
This comment has been minimized.
Duplicate of #16 |
Hi! Thanks for taking the time to contribute! Because we treat issues as our backlog, we close duplicates to focus our work and not have to touch the same chunk of code for the same reason multiple times. This is also why we may mark something as duplicate that isn’t an exact duplicate but is closely related. Thanks, |
option.slug
function?option.slug
function (or options.slugger
implementation)?
Yes, I did search the existing issues and there didn't seem to be the same issue. The one linked as a potential duplicate is related but not the same. I certainly get the perspective of the fact that it is a short only 15 line plugin, but with only an extra 3 lines it could be tremendously more powerful. A quick example of what I was think to submit (and/or fine to make its own plugin, but this seems generic enough to be pretty helpful to many while still being opinionated by default as it currently stands):
|
If that looks interesting/helpful still, let me know and happy to put in place test coverage and submit as a PR @wooorm?? |
No, thanks. I think it’s a bad idea. For reasons explained above, and linked here: #16 (comment) |
Examples of behavior that contributes to creating a positive environment include:
|
Quoting the CoC to me is a good example of not being respectful of differing viewpoints and experiences. I have been kind to you, I am not interested in maintaining your code for the rest of my life, and I don’t want to push your code to millions of people. That does not make your code bad. You can use your code. I’m locking this conversation as it’s done. |
Initial checklist
Problem
While
github-slugger
is one of the most popular (if not THE most popular) slugging functions, there may be the case where someone wants to use an alternate implemenation such asslugify
(or even their own custom slug generator).Solution
Add a new property to the
options
object to optionally support sending in your ownslug
function. If notslug
option is passed in, default to the current use ofgithub-slugger
Alternatives
I'm certain there are a number of other approaches here (even creating an alternate plugin), but happy to contribute a PR to add in this option!
The text was updated successfully, but these errors were encountered: