Closed animaux closed 5 months ago
Thanks, this one is a bit tricky because we can't interpret the conjunction. I'll see if I can fix this issue without breaking anything selse (E–Mail
is definitely a bug, but the list might be a ”damned if you do, damned if you don't” situation. There is only so much you can do via regexes.
@animaux, do you really mean version 6.0.0 of PHP-Typography? If you, please try updating to a recent version and check if this still occurs.
Thank you! I understand ;)
As for the version. I thought this was the version the typogrify plugin for craft cms uses. I don’t know much about composer, but there is this in the composer.json
:
"require": {
…
"mundschenk-at/php-typography": "^6.0"
},
Or does it mean »Version 6.0 and upwards?«
Yes, that means "any 6.x version". You should be able to see the actual version in the composer.lock
file (should 6.6.0
).
Thanks for the pointer! composer.lock
lists version 6.6.0
.
Regarding E-Mail
: Is that result above an c&p or manually retyped? Because you should see E‑Mail
, which is the non-breaking hyphen. If you really do get an –
there, I need a standalone example (so that I know the exact settings and we can rule-out any post-processing by Craft or the plugin).
Same for the Kunst-, Kultur- und Architekturgeschichte
, the first -
is replaced with ‑
to prevent a break before the ,
.
I think it must have been Copy & Paste. This one is for sure: Kunst‑, Kultur- und Architekturgeschichte
. Checking it directly via decodeunicode it returns a U+02011 NON-BREAKING HYPHEN
after Kunst
and a U+0002D HYPHEN-MINUS
after Kultur
. So the latter is actually not an endash, but it's evil twin!
I can’t reproduce the endash in E-Mail anymore, so I think it must have been a copy & paste error. Sorry for that.
There’s a good chance something else is messing with the text, since the craft typogrify extension uses several libraries, including smartypants, I think. I will put together a testcase for this and the other issue tomorrow. Thanks for looking into this!
Here’s a simple test-case: https://gist.github.com/animaux/ae3e2a96f886f8dedb3ca736194e84a0
Test-source-html:
<p>Die Stiftung Preußische Schlösser und Gärten Berlin-Brandenburg (SPSG) betreut heute die schönsten und bedeutendsten Zeugnisse der Kunst-, Kultur- und Architekturgeschichte in Brandenburg-Preußen.</p><p>E-Mail.</p><p>Seit Januar 2018 sind diese Zeugnisse herzoglicher Repräsentation in einer landeseigenen Kulturinstitution – den Staatlichen Schlössern, Gärten und Kunstsammlungen Mecklenburg-Vorpommern (kurz: SSGK M-V) – zusammengefasst.</p><p>UNESCO-Welterbestätten UNESCO Welterbestätten.</p>
Results are as follows:
Kunst-
becomes a NON-BREAKING HYPHEN
which for some reason is rendered longer than a normal hyphen in macOS 10.15.7 Safari 15.3, but looks fine in Firefox. So this seems to be a Safari or System-Font problem.E-Mail
and M-V
One issue remains (that may be intentional?):
UNESCO
is not wrapped in span.caps
if it is connected to another word with a hyphen. See last paragraph.Feel free to close this, as the UNESCO-Welterbestätten
-Problem can be solved by using a NON-BREAKING HYPHEN
in the source text.
Thanks for your help and effort!
I have created a new ticket for the caps issue (#174).
The german string
Kunst-, Kultur- und Architekturgeschichte
is renderedKunst–, Kultur- und Architekturgeschichte
, the first hyphen is replaced with an en-dash, but should remain a hyphen.Another example is the german spelling of email —>E-Mail
which unintendedly becomesE–Mail
.Version is 6.0 (in Craft Typogrify plugin)