Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

urlize Apostrophes for French #32

Open
CedCannes opened this issue May 26, 2020 · 0 comments
Open

urlize Apostrophes for French #32

CedCannes opened this issue May 26, 2020 · 0 comments

Comments

@CedCannes
Copy link

While updating an old project, I realized that urlize wasn't working the way it used to before.

before (long time ago):
"c'est qu'il m'énerve" -> "c-est-qu-il-m-enerve"

now :
"c'est qu'il m'énerve" -> "cest-quil-menerve"

// Remove apostrophes which are not used as quotes around a string
$text = preg_replace('/(\\w)\'(\w)/', '${1}${2}', $text);

it's not really a problem.
but as I don't want to change the old urls of the site I'm going to turn the "'" into " " before using urlize.

But maybe there could be an option to decide if we want to make the apostrophes disappear or turn them into a dash. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant