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

soft hyphens and generateAlias #560

Closed
ghost opened this issue Aug 3, 2016 · 14 comments
Closed

soft hyphens and generateAlias #560

ghost opened this issue Aug 3, 2016 · 14 comments

Comments

@ghost
Copy link

ghost commented Aug 3, 2016

Issue by @micha-nerdlichter
August 2nd, 2016, 09:53 GMT

Following the arguments in #2709 shouldn't generateAlias be using the shy-free title? I see no sense in replacing the shy entities with - e.g. the page title Schiff[-]fahrts[-]markt[-]bericht generates the alias schiff-fahrts-markt-bericht.

@ghost
Copy link
Author

ghost commented Aug 3, 2016

Comment by @leofeyer
August 2nd, 2016, 15:15 GMT

It actually does not on my system. Can this be reproduced in the online demo?

@ghost ghost added the bug label Aug 3, 2016
@ghost
Copy link
Author

ghost commented Aug 3, 2016

Comment by @Toflar
August 2nd, 2016, 20:14 GMT

I read the source code and it should really not happen. Moreover, I couldn't reproduce it in the latest 3.5 version which you should obviously be using before reporting a bug :)

@ghost
Copy link
Author

ghost commented Aug 3, 2016

Comment by @ADoebeling
August 2nd, 2016, 20:25 GMT

I also can't reproduce this issue.

image

@ghost
Copy link
Author

ghost commented Aug 3, 2016

Comment by @micha-nerdlichter
August 3rd, 2016, 10:33 GMT

Oh, I tried this in Contao 4.2.1 and started this issue in 3.5 Sorry, my bad. I'll check this in 3.5. But shouldn't this be fixed in 4.2.1 too?

@leofeyer leofeyer added this to the 4.2.2 milestone Aug 3, 2016
@leofeyer
Copy link
Member

leofeyer commented Aug 3, 2016

It does not need to be fixed in Contao 3.5, because the issue does not occur there. However, I can reproduce it in Contao 4.2.

@leofeyer
Copy link
Member

leofeyer commented Aug 4, 2016

I have debugged the issue and the different behavior is caused by the Patchwork\Utf8::toAscii() method, which converts soft-hyphens to regular hyphens. In Contao 3, we are using utf8_romanize(), which leaves the soft-hyphens untouched, so they are replaced further down the code.

I would fix this by adding the following line to the standardize() function:

$strString = str_replace('­', '', $strString);

@contao/developers Any objections?

@Toflar
Copy link
Member

Toflar commented Aug 4, 2016

I am not happy with any of these methods anyway so it's okay for me.

@aschempp
Copy link
Member

aschempp commented Aug 4, 2016

Yeah, same here. Please also add the following to get the original behavior back…

$strString = str_replace(['ä', 'Ä', 'ö', 'Ö', 'ü', 'Ü'], ['ae', 'AE', 'oe', 'OE', 'ue', 'UE'], $strString)

@leofeyer
Copy link
Member

leofeyer commented Aug 4, 2016

That's only a small subset of "the original behavior", because it fixes the German characters only.

@leofeyer
Copy link
Member

leofeyer commented Aug 4, 2016

Also, Ä should be converted to Ae instead of AE, because you write Aepfel and not AEpfel. 😄

@aschempp
Copy link
Member

aschempp commented Aug 4, 2016

Also, Ä should be converted to Ae instead of AE, because you write Aepfel and not AEpfel. 😄

You might be right about that. Except if the whole word is uppercase… dunno what the previous behavior was.

@leofeyer
Copy link
Member

leofeyer commented Aug 4, 2016

@leofeyer
Copy link
Member

leofeyer commented Aug 4, 2016

If you look at the romanize sub-array, you see what we would actually have to convert to restore the previous behavior. Maybe we should not have switched to the Utf8 library.

@leofeyer leofeyer removed this from the 4.2.2 milestone Aug 5, 2016
@leofeyer
Copy link
Member

leofeyer commented Aug 11, 2016

I have created a PR here: #569

leofeyer pushed a commit that referenced this issue Jul 8, 2019
Description
-----------

As discussed in #557

Commits
-------

edbb1ba2 Detect if WEBP is supported
65382338 Improve wording
7a21f88c Don’t show help message if webp was explicitly disabled
ef0775fd Make the tl_image_sizes::isWebpSupported() method private
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants