slug-generator
slug-generator copied to clipboard
Should we make sure that the delimiter is part of the valid chars?
See https://github.com/contao/contao/issues/8325
I think this could be problematic when using delimiters that are more than one character wide, e.g.:
$generator->generate('Hello World!', ['delimiter' => '%20']); // Result: hello%20world
In this case you probably don’t want to allow the % character in the rest of the string, e.g.:
$generator->generate('Now -10% dicount!', ['delimiter' => '%20']); // Result: now%2010%20dicount
@aschempp what do you think?
Personally I would use a whitespace in this case and replace it later on. But you're right that this could be a problem.