Comments (2)
This is actually correct behavior according to Unicode. The difference in your first example between the first hyphen where it does break, and the second hyphen when it does not is that the character after the second hyphen is a number rather than a letter. This is to distinguish between usage of the hyphen as a minus sign, in which case it should not break. See http://www.unicode.org/reports/tr14/#HY.
You can manually add a zero width space character (\u200B
) after the hyphen to provide a break opportunity there.
from linebreak.
Alternatively, use the explicit hyphen character (\u2010
) instead of the hyphen-minus character (\u002d
). That will also allow breaks.
from linebreak.
Related Issues (17)
- Not working in webpack HOT 13
- `npm audit` flags `brfs` as a security vulnerability HOT 2
- Missing LICENSE file. HOT 1
- how to support cjk ? HOT 1
- Can u release a more common version? HOT 1
- how to detect slipped word is English or CJK ?
- Release new version and update dependency in pdfkit HOT 8
- Redundant 'if' statement HOT 1
- Not returning required flag for trailing CR LF
- Possible bug in line break trie data
- Please add the test folder and coffeescript files to .npmignore HOT 1
- Not able to integrate this library for ReactJS. Guidelines / Fix needed. HOT 4
- library not working properly for emoji HOT 1
- Error: File 'classes.trie' not found in virtual file system HOT 1
- Can't resolve 'fs' ERROR in ./~/linebreak/src/linebreaker.js HOT 4
- Doesn't work on big endian hosts HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linebreak.