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 hyphenation library, based on Franklin M. Liang's hyphenation algorithm. In core of the algorithm lies a set of hyphenation patterns. They are extracted from hand-hyphenated books and articles. Patterns for this library were taken from ctan.org and ported to Javascript.
var text = "A certain king had a beautiful garden";
var hyphenate = createHyphenator(hyphenationPatternsEnGb);
var hyphenatedText = hyphenate(text);
console.log(hyphenatedText);
// A cer-tain king had a beau-ti-ful garden
Check the demo
npm install hyphen
\u00AD
character to something else, use hyphenChar: "-"
var hyphenate = createHyphenator(hyphenationPatternsEnGb, {hyphenChar: '-'});
debug: true
var hyphenate = createHyphenator(hyphenationPatternsEnGb, {debug: true});
var hyphenate = createHyphenator(hyphenationPatternsEnGb, {async: true});
hyphenate(text).then(function(hyphenatedText) {
console.log(hyphenatedText)
});
Afrikaans, Ancient Greek, Armenian, Assamese, Bahasa Indonesia, Basque, Bengali, Bulgarian, Catalan, Chinese pinyin syllables, Church Slavonic, Classical Latin, Coptic, Croatian, Czech, Danish, Dutch, English (GB), English (US), Estonian, Ethiopic, Finnish, French, Friulan, Galician, Georgian, German, Gujarati, Hindi, Hungarian, Icelandic Plain, Interlingua, Irish, Italian, Kannada, Kurmanji, Latin, Latvian, Lithuanian, Liturgical Latin, Malayalam, Marathi, Modern Monotonic, Modern Polytonic, Mongolian, Norwegian, Norwegian Bokmal, Norwegian Nynorsk, Occitan, Oriy, Pāli, Panjabi, Piedmontese, Polish, Portuguese, Romanian, Romansh, Russian, Sanskrit and Prakrit, Serbian Cyrillic, Serbocroatian Cyrillic, Serbocroatian Latin, Slovak, Slovenian, Spanish, Swedish, Swiss-German, Tamil, Telugu, Thai, Turkish, Turkmen, Ukrainian, Upper Sorbian, Welsh
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 other great hyphenation libraries:
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.