Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
This is a JavaScript implementation of Franklin M. Liang's hyphenation algorithm. It relies on fast programming techniques to reduce execution time. The accuracy of hyphenation results depend on the quality of predefined patterns collections, that are different for every language. This implementation uses patterns collections from the TeX website, http://www.ctan.org/.
var hyphenate = createHyphenator(hyphenationPatternsEnGb);
var initialText = "A certain king had a beautiful garden"
var hyphenatedText = hyphenate(initialText);
// A cer-tain king had a beau-ti-ful garden
npm install hyphen
or
bower install hyphe
There are a couple of settings you can use to configure hyphenator function:
\u00AD
character to something else, use hyphenChar: "-"
var hyphenate = createHyphenator(hyphenationPatternsEnGb, {hyphenChar:'-'})
debug: true
var hyphenate = createHyphenator(hyphenationPatternsEnGb, {debug:true})
The CSS hyphens
property is intended to add hyphenation support to modern browsers without Javascript:
p {
hyphens: auto;
}
It is part of the CSS Text Level 3 specification. The browser compatibility list can be found on the related MDN page.
Check out other well-known Javascript hyphenation algorithm implementations:
MIT
FAQs
Text hyphenation in Javascript.
The npm package hyphen receives a total of 442,146 weekly downloads. As such, hyphen popularity was classified as popular.
We found that hyphen demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.