1.3.0 • Published 8 years ago

non-breaking-spaces v1.3.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

Library

The description of the library.

Installation and Usage

Installation

To install this javascript module.

npm install non-breaking-spaces

Usage

Convert text and HTML so that white spaces before ponctuation are transformed into non-breaking spaces ( ).

// import CommonJS
var nonBreakingSpaces = require('non-breaking-spaces');

var text = nonBreakingSpaces.noBreak('Ce texte nécessite une petite correction !');
// Ce texte nécessite une petite correction !

or with EcmaScript6:

// import ES6 Module
import {noBreak as nonBreakingSpaces} from 'non-breaking-spaces';

var text = nonBreakingSpaces('Ce texte nécessite une petite correction !');
// Ce texte nécessite une petite correction !

You may also want to change the replacer:

nonBreakingSpaces.setOptions('replacer', ' ');
// or
nonBreakingSpaces.setOptions({
  replacer: '\\u00a0'
});