Skip to content

radiovisual/metalsmith-remove-empty-tags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

metalsmith-remove-empty-tags

Build Status

Remove empty HTML tags from your metalsmith template files.

⚠️ Not fully tested or production ready. Use at your own risk. There are a few items on the roadmap to v1.0, but I am not sure when I will get around to this, so Pull Requests are welcome to help extend test coverage and close some issues.

Install

$ npm install --save metalsmith-remove-empty-tags

Usage

var Metalsmith = require("metalsmith");
var removeEmptyTags = require("metalsmith-remove-empty-tags");

Metalsmith(__dirname)
  // ... state when html files are available
  .use(removeEmptyTags(['p']))
  // ..

API

removeEmptyTags(tags)

tags

Type: array

An array of HTML tags to look for.

TODO

  • supply tag names to remove
  • remove all empty tags by default (if no tags are supplied)
  • option to ignore files
  • option to ignore tags with certain classes
  • better test coverage

License

MIT © Michael Wuergler

About

Remove empty HTML tags from your Metalsmith template files.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published