Skip to content
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

How to force slug-generator not to convert a comma? #18

Open
Dudaevskiy opened this issue Sep 17, 2019 · 2 comments
Open

How to force slug-generator not to convert a comma? #18

Dudaevskiy opened this issue Sep 17, 2019 · 2 comments
Labels

Comments

@Dudaevskiy
Copy link

Dudaevskiy commented Sep 17, 2019

Hello, thanks for your great product.
Now I am writing a plugin for CMS Grav, and I need a comma to not be cropped after processing the line.
For example, there was a line like this:
WordPress, Plugins WordPress
It became like this:
wordpress,plugins-wordpress

How do I get the comma to remain in the link?

@ausi
Copy link
Owner

ausi commented Sep 17, 2019

Hi, thanks for the great feedback!

You can use the validChars option to achieve this:

$generator = new \Ausi\SlugGenerator\SlugGenerator;
$generator->generate('WordPress, Plugins WordPress', ['validChars' => 'a-z0-9,']);

@ausi ausi added the question label Sep 19, 2019
@Dudaevskiy
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants