Puppeteer does not honor hyphens:auto
See original GitHub issueIn Chromium 88, support for hyphens: auto was added.
https://www.chromestatus.com/feature/5672891947417600
However when using a puppeteer version that supports chromium 88 or above, hyphens:auto does not behave as expected.
I have downloaded the current version of chrome 88 locally, as well as the beta and canary versions. When viewing a test html file utilizing hyphens: auto in these chrome versions, the behavior works as expected and words are automatically hyphenated when the screen becomes too thin.
However if I boot these SAME executables up using puppeteer, and open the EXACT SAME test file, the hyphen behavior does NOT work as expected, and no hyphens appear.
My example hyphens test file is below.
<html lang="en">
<div style="word-break: break-word; hyphens: auto;">
reallylongwordwithnobreaksatall reallylongwordwithnobreaksatall reallylongwordwithnobreaksatall reallylongwordwithnobreaksatall reallylongwordwithnobreaksatall
</div>
</html>
Steps to reproduce
Tell us about your environment:
- Puppeteer version: Any, I have tried 5.5.0 - 7.0.1
- Platform / OS version: Windows/Chrome
- URLs (if applicable):
- Node.js version:
What steps will reproduce the problem?
Please include code that reproduces the issue.
- Boot up a non-headless version of puppeteer
- View the above html file and notice that it does not match what the file looks like when using the corresponding chrome version.
What is the expected result?
Puppeteer should match chrome behavior for hyphens: auto
What happens instead?
Puppeteer does not match chrome behavior for hyphens: auto
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:10

Top Related StackOverflow Question
If someone need this feature for his product, he can try a look at Hyphenopoly
I got answer from Chromium bugs: https://bugs.chromium.org/p/chromium/issues/detail?id=1261480#c5
The option
--headless=chrome(orUSE_HEADLESS_CHROMEenvironment variable) on Linux would be worth testing.