3.0.2 • Published 4 years ago

hyphe-lib-ger v3.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

hyphe-lib-ger.js

npm version Build Status npm.io

Add soft-hyphens to German text

CHANGELOG

About

Using the packages hypher and hyphenation.de to parse a normal, German text adding soft-hyphens to allow soft-hyphens in older browsers and Google Chrome.

New: Use typographizer-js to produce better looking typography

Install

In your terminal use

npm i --save hyphe-lib-ger

In your JavaScript file use

const hyphe = require("hyphe-lib-ger");

Usage

hyphe(Text, { Options }).then(text => {
  console.log(text); // Output the formatted text
});

Text: String A String with the text to parse

Options: Object The possible options (not required)

Options

typographize: Boolean (default: false)

  • parse the text with typograhize-js first

ignoreLineBreaks: Boolean (default: false)

  • ignore line breaks completely?

escapeToHTML: Boolean (default: true)

  • escape all non-word characters to their HTML charcode alternative

Example

const hyphe = require("hyphe-lib-ger");

hyphe(
  `Lass mich dir kurz vorstellen, was hier eigentlich möglich ist: "Hallo, mein Name ist Daniel"`
).then(res => {
  console.log(res);
});

/*
Will return:
Lass mich dir kurz vor­stel­len, was hier ei­gent­lich mög­lich ist: “Hal­lo, mein Na­me ist Da­ni­el”
*/

Example

A working example with this lib and Angular6 is seen here

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

5 years ago

2.2.0

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.1

6 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago