Skip to content

Commit

Permalink
uncss now ignores external stylesheets.
Browse files Browse the repository at this point in the history
  • Loading branch information
vseventer committed Jul 31, 2015
1 parent 0654eed commit 5164bfc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog

## 0.1.2
## 0.1.3 (July 31, 2015)
* Bugfix: uncss now ignores external stylesheets.

## 0.1.2 (July 26, 2015)
* Added debug statements using [`debug`](https://github.com/visionmedia/debug).
* Fixes [#1](https://github.com/vseventer/hexo-uncss/issues/1): Handle scenario where there are no generated HTML files.

Expand Down
7 changes: 6 additions & 1 deletion lib/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ module.exports = function(str, locals) {

// UnCSS the raw HTML with the CSS provided.
return promise.then(function(rawHtml) {
var options = assign({ }, config, { raw: str }); // Init.
// Process raw css. Ignore any external stylesheets.
var options = assign({ }, config, {
ignoreSheets : [ '_' ], // Hack to ignore any ..
stylesheets : [ '_' ], // .. external stylesheets.
raw: str
});

// Return the result.
return Promise.fromNode(function(callback) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "hexo-uncss",
"version" : "0.1.2",
"version" : "0.1.3",
"description" : "uncss plugin for Hexo.",
"keywords" : [ "hexo", "hexo-plugin", "hexo-filter", "uncss", "css", "html" ],
"homepage" : "https://github.com/vseventer/hexo-uncss",
Expand Down
1 change: 1 addition & 0 deletions test/fixture.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<!doctype html>
<link rel="stylesheet" href="fake.css" />
<div>Hello World</div>

0 comments on commit 5164bfc

Please sign in to comment.