Miss any of our Open RFC calls?Watch the recordings here! »

metalsmith-widow

1.1.1 • Public • Published

metalsmith-widow Build Status NPM version Dependency Status

Add non breaking spaces to the ends of block level elements, with Metalsmith.

If you have any issues with the output of this plugin, please use the widow tracker.

Install via npm:

npm install metalsmith-widow --save

Example

var widow      = require('metalsmith-widow'),
    markdown   = require('metalsmith-markdown'),
    Metalsmith = require('metalsmith');
 
Metalsmith('fixtures')
    .use(markdown())
    .use(widow())
    .build(function (err) {
        if (err) {
            throw err;
        }
    });

With custom options:

Metalsmith('fixtures')
    .use(markdown())
    .use(widow({
        selectors: 'h1.h2.h3.h4.h5.h6'.split('.')
    }))
    .build(function (err) {
        if (err) {
            throw err;
        }
    });

Options

See the widow documentation.

Contributing

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

License

MIT © Ben Briggs

Install

npm i metalsmith-widow

DownloadsWeekly Downloads

2

Version

1.1.1

License

MIT

Last publish

Collaborators

  • avatar