Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 17be8c5 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
15b555f to
4874827
Compare
ee0c48b to
b9f8ed3
Compare
|
I came across this draft PR and it seems to address the word-breaking issue in react-pdf. From a quick look/testing, it behaves closer to native CSS word-break support, which has been a common limitation. Would love your review on whether this approach makes sense. |
1d0641e to
3e415a5
Compare
| @@ -1,9 +1,60 @@ | |||
| import LineBreaker from 'linebreak'; | |||
There was a problem hiding this comment.
It is used in pdfkit
https://github.com/foliojs/linebreak
3e415a5 to
2d04568
Compare
# Conflicts: # packages/layout/tests/text/layoutText.test.ts # packages/textkit/src/engines/linebreaker/index.ts
# Conflicts: # packages/stylesheet/src/types.ts # packages/textkit/package.json
|
@exoego is attempting to deploy a commit to the diegomura Team on Vercel. A member of the Team first needs to authorize it. |
|
@diegomura Fixed conflict. Could you take a look 🙇 |
Soft wrap opportunities and hyphenation opportunities were mixed in one list, so a hyphen showed at any break inside a word. URLs got "/-", hyphenated words got "--", and break-all added hyphens. Syllables now record the kind of each break. Only hyphenation breaks show the hyphenate character. - hyphens: none does not hyphenate, even at soft hyphens - hyphens: manual hyphenates only at soft hyphens - break-all applies no hyphenation and keeps punctuation rules - keep-all keeps letters together but still breaks after punctuation - breaks between text runs follow UAX diegomura#14
-#638This PR leverages https://github.com/foliojs/linebreak which is used in foliojs/pdfkit
Long paragrah was borrowed from MDN for
word-breakhyphens,hyphenateCharacterandwordBreakfollow CSS Text Level 4. A hyphen shows only at hyphenation breaks, not at breaks after-or/, between CJK characters, or withbreak-all. Unlike CSS,hyphensdefaults toautoto keep the existing behavior.