Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tags with the letter n in them are not purged #195

Closed
mdickopp opened this issue May 31, 2019 · 0 comments
Closed

Tags with the letter n in them are not purged #195

mdickopp opened this issue May 31, 2019 · 0 comments
Labels

Comments

@mdickopp
Copy link

Tags that have the letter n in them (e.g. input, main) are not purged.

Code to reproduce:

const Purgecss = require('purgecss');

const purgecss = new Purgecss({
  content: [{
    raw: '<h1></h1>',
  }],
  css: [{
    raw: 'h1 { margin: 0; } h2 { margin: 0; } input { margin: 0; }'
  }]
});

console.log(purgecss.purge()[0].css);

Expected output:

h1 { margin: 0; }

Actual output:

h1 { margin: 0; } input { margin: 0; }

I think that the regular expression in line 328 in src/index.js might be the culprit, since it matches tags that have an n in them.

@Ffloriel Ffloriel added the bug label Oct 31, 2019
@Ffloriel Ffloriel added this to the v2 milestone Nov 1, 2019
samzlab pushed a commit to samzlab/purgecss that referenced this issue Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants