elrh-pslo

1.0.1 • Public • Published

elrh-pslo

Text-enhancement function to prevent single letter words and other special symbols and abbreviations being orphaned at the end of the wrapped line.

The "pslo" abbreviation stands for Prevent Single Letter Orphans, which is also the name of the core function provided by this micro-library.

how to use

npm instal elrh-pslo to include into your project.

Use preventSingleLetterOrphans to treat your text inputs. The function will include non-breaking spaces represented as \xa0 unicode characters based on various rules.

const input: string = "Text with single letter words like a or i or symbols like % and various others."
const output: string = preventSingleLetterOrphans(input)

tech stack

report bugs & contact

Use GitHub issues to report bugs / propose enhancements / give feedback: https://github.com/AloisSeckar/elrh-pslo/issues

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i elrh-pslo

    Weekly Downloads

    30

    Version

    1.0.1

    License

    none

    Unpacked Size

    12.9 kB

    Total Files

    12

    Last publish

    Collaborators

    • ellrohir