remark-word-wrap
v2.0.2
Published
Wrap lines of Markdown to a specified width.
Downloads
8
Readme
remark-word-wrap
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