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

Auto-hyphen rendering issue on Chrome with macOS Monterey #892

Open
tw77 opened this issue Nov 8, 2021 · 2 comments
Open

Auto-hyphen rendering issue on Chrome with macOS Monterey #892

tw77 opened this issue Nov 8, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@tw77
Copy link
Contributor

tw77 commented Nov 8, 2021

Description

When using Chrome after updating to macOS Monterey, and when viewing a webbook that uses the McLuhan, Asimov, Baker, or Pressbooks Custom CSS theme, the hyphens that automatically break up words at the right margin of a paragraph do not render properly. These hyphens just appear as empty squares.

This is affecting a user here: https://pressbooks.zendesk.com/agent/tickets/8091

Steps to Reproduce

  1. Update to macOS Monterey (this bug does not appear on macOS Big Sur)
  2. View or create a book with the McLuhan, Asimov, Baker, or Pressbooks Custom CSS theme (all other themes are unaffected by this bug)

Expected behavior: A longer word at the edge of the right margin of a paragraph will be automatically broken up by a hyphen and continued on the next line.

Actual behavior: The word is broken up and continued on the next line, but the hyphen doesn't render. An empty square is displayed instead of the hyphen.

@SteelWagstaff SteelWagstaff added the bug Something isn't working label Nov 10, 2021
@LeighKP
Copy link

LeighKP commented Dec 7, 2021

Just found an instant of this in the User Guide and thought I'd add a screenshot.
Screen Shot 2021-12-07 at 12 13 44 PM

@tw77
Copy link
Contributor Author

tw77 commented Jan 14, 2022

I’ve noticed this auto-hyphen rendering bug on two different websites, and I see that it’s now a known issue with Chromium-based browsers including Google Chrome. It only happens on macOS Monterey. Reported here: https://bugs.chromium.org/p/chromium/issues/detail?id=1267606

The patch for this bug will be included in Chromium 98 which is due for release on Feb 1st, 2022. So in the near-future, updating Google Chrome should be sufficient to do away with this issue. But there's also an effective workaround noted in this blog post, which is the following CSS code:

html {
    -webkit-hyphenate-character: '-';
}

Adding this code to a book (under Appearance > Custom Styles, in “Your Web Styles”) gets the auto-hyphens to appear normally on Chrome while running macOS Monterey and viewing books with the affected themes:

css

Before:
before

After:
after

(Adding this code should have no consequence for browsers and operating systems that aren't affected by the bug. After viewing this test book with Chrome + macOS Monterey, I opened it with Firefox, then Chrome + an earlier macOS, where it continued to render correctly.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants