Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Add regex support to whitelist #33

@fstanis

Description

@fstanis

This would allow using the same whitelist as used with uncss. Would also be good if we could add ignore as an alias of whitelist in options.

Example usage:

var posthtml = require('posthtml');
var uglify = require('posthtml-uglify');

posthtml()
  .use(uglify({ whitelist: [/\.[ab]ar/] }))
  .process('<style>#foo { color: red } .bar { color: blue } .aar { color: aqua }</style><div id="foo" class="bar">baz</div>')
  .then(function(result) {
    console.log(result.html); //=> '<style>#xz { color: red } .bar { color: blue } .aar { color: aqua }</style><div id="xz" class="bar">baz</div>'
  });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions