vincent-peugnet / wcms

⧉ light-weight, experimental CMS where you use link to think and publish ideas by creating poly-form site
http://w.club1.fr
GNU Affero General Public License v3.0
20 stars 5 forks source link

better sluggyfier #373

Open vincent-peugnet opened 9 months ago

vincent-peugnet commented 9 months ago

Currently W's accent remove for ID is very homemade. I just did some basic french-used-accent replacement.

I could use a better function, for exemple the one used by Wordpress :

https://github.com/WordPress/wordpress-develop/blob/87dfd5514b52aef456b7232b1959873e69e651da/src/wp-includes/formatting.php#L1607-L2013

https://developer.wordpress.org/reference/functions/remove_accents/

vincent-peugnet commented 9 months ago

Someone have created a composer package with it:

https://github.com/rap2hpoutre/convert-accent-characters

Usefull if I want to have more dependecies ;)

https://packagist.org/packages/rap2hpoutre/convert-accent-characters (15 000 installs)

vincent-peugnet commented 9 months ago

OR event the biggg solution:

https://github.com/voku/portable-ascii

vincent-peugnet commented 9 months ago

Or event bigger: The slugyfier

https://github.com/cocur/slugify

vincent-peugnet commented 9 months ago

AND at least another option: Using PHP transliterator

https://www.php.net/manual/en/transliterator.transliterate.php#111939