ausi/slug-generator

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

Dudaevskiy opened this issue · 2 comments

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 commented

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,']);

Thanks