remark-word-wrap

2.0.2 • Public • Published

remark-word-wrap Build Status NPM version Dependency Status

Wrap lines of Markdown to a specified width.

Install

With npm do:

npm install remark-word-wrap

Example

var remark = require('remark');
var wrap = require('remark-word-wrap');
var markdown = 'Hello, world!';
var result = remark().use(wrap, {width: 5}).process(markdown);

Output:

 
Hello,
world!

API

Add extra line breaks to paragraph nodes to ensure that they fit to a specified width.

remark.use(wrap, [options])

options

indent

Type: string Default: '' (empty)

Prepend this string to the start of each line.

newline

Type: string Default: \n

Append this string to the end of each line.

width

Type: number Default: 72

The maximum length of the line. Note that this does not include additional characters from elements like lists.

Contributing

Pull requests are welcome. If you add functionality, then please add unit tests to cover it.

License

MIT © Ben Briggs

Package Sidebar

Install

npm i remark-word-wrap

Weekly Downloads

4

Version

2.0.2

License

MIT

Last publish

Collaborators

  • remcohaszing
  • johno
  • wooorm