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

Unfriendly word-splitting on links in emails #3514

Open
mattcen opened this issue Aug 9, 2023 · 4 comments
Open

Unfriendly word-splitting on links in emails #3514

mattcen opened this issue Aug 9, 2023 · 4 comments

Comments

@mattcen
Copy link

mattcen commented Aug 9, 2023

Problem and impact

When sending an email with Pretix which contains hyperlinks with text that gets split across multiple lines, the text gets split mid-word.

Digging suggests the problem is here:

Which was last changed in 0990eee.

(FYI @daisylb)

Expected behaviour

Splitting should occur on word boundaries.

Steps to reproduce

No response

Screenshots

Screenshot 2023-08-09 at 12 28 55
Screenshot 2023-08-09 at 12 29 02

Link

No response

Browser (software, desktop or mobile?) and version

Problem occurs when email is viewed in FastMail web UI, Apple Mail 16.0 (3731.700.6), Thunderbird 115.1.0

Operating system, dependency versions

No response

Version

Instance running at https://pretix.eu/pyconau/2023/

@raphaelm
Copy link
Member

raphaelm commented Aug 9, 2023

Hmm, this is tough. We introduced this new CSS because people where complaining about long links (like a MS teams invitation link) breaking the entire layout of the email. Not sure how a middle ground could look here (that is still supported by many email clients, which often have an old HTML engine)

@mattcen
Copy link
Author

mattcen commented Aug 10, 2023

Hmm, yeah, I acknowledge that would be a more significant issue than the mid-word splitting I'm seeing. ☹️

@wiffbi
Copy link
Contributor

wiffbi commented Aug 14, 2023

Wouldn’t word-wrap: break-word; do what we want? The behaviour with long MS-teams-links would change a little bit as in if they are longer than the remaining line, they would start on a new line and then break mid-word if they are longer than the full line. See example and play with adding words at https://jsfiddle.net/4AKhn/1/ from the first comment at https://stackoverflow.com/a/3058881

@raphaelm
Copy link
Member

raphaelm commented Aug 22, 2023

We already set break-word before:

p {
margin: 0 0 10px;
/* These are technically the same, but use both */
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-word;
-ms-word-break: break-all;
/* Adds a hyphen where the word breaks, if supported (No Blink) */
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto;
}
p a {
word-wrap: anywhere;
word-break: break-all;
}

Unfortunately, I'm unable to find the support request that caused me to add break-all currently. I assume that some email clients do not support break-word, or I would have never added the break-all

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

3 participants