Open saurabh2k26 opened 6 years ago
Can you post the code you are using?
I'm with same problem in portuguese.
Input is: Um mês de conteúdo Expected output: um-mes-de-conteudo Actual output: um-me-s-de-conteu-do
Whenever you replace a character, you add (in addition to the replaced character) a separator.
@saurabh2k26 To be honest, it’s good idea to replace any character different than a-z
or 0-9
with separator. In this case apostrophe is also replaced with -
. It’s simple and clear.
If we would like to go another way, additional options would be needed to implement:
Optionally we can just clear all the special characters. In this way 2nd new option won’t be necessary, because empty string will be used as separator.
@florianeckerstorfer Any thoughts?
@tenq Have you tried to use portuguese-brazil
or french
ruleset?
$slugify->slugify('Um mês de conteúdo', ['ruleset' => 'portuguese-brazil']);
// or
$slugify->slugify('Um mês de conteúdo', ['ruleset' => 'french']);
Input is: Saurabh's Blog Expected output: saurabhs-blog Actual output: saurabh-s-blog