[String] Transliterate & to and
This commit is contained in:
parent
31fb219896
commit
76ff984ab5
@ -98,6 +98,7 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface
|
||||
return (new UnicodeString($string))
|
||||
->ascii($transliterator)
|
||||
->replace('@', $separator.'at'.$separator)
|
||||
->replace('&', $separator.'and'.$separator)
|
||||
->replaceMatches('/[^A-Za-z0-9]++/', $separator)
|
||||
->trim($separator)
|
||||
;
|
||||
|
@ -31,6 +31,8 @@ class SluggerTest extends TestCase
|
||||
{
|
||||
return [
|
||||
['Стойността трябва да бъде лъжа', 'bg', 'Stoinostta-tryabva-da-bude-luzha'],
|
||||
['You & I', 'en', 'You-and-I'],
|
||||
['symfony@symfony.com', 'en', 'symfony-at-symfony-com'],
|
||||
['Dieser Wert sollte größer oder gleich', 'de', 'Dieser-Wert-sollte-groesser-oder-gleich'],
|
||||
['Dieser Wert sollte größer oder gleich', 'de_AT', 'Dieser-Wert-sollte-groesser-oder-gleich'],
|
||||
['Αυτή η τιμή πρέπει να είναι ψευδής', 'el', 'Avti-i-timi-prepi-na-inai-psevdhis'],
|
||||
|
Reference in New Issue
Block a user