From 5164bfcbb2183ded5f63704bc79cfe9c378dc635 Mon Sep 17 00:00:00 2001 From: vseventer Date: Fri, 31 Jul 2015 20:54:54 +1000 Subject: [PATCH] uncss now ignores external stylesheets. --- CHANGELOG.md | 5 ++++- lib/filter.js | 7 ++++++- package.json | 2 +- test/fixture.html | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 670ffe2..80e4137 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/lib/filter.js b/lib/filter.js index 258157c..3f6e7f4 100644 --- a/lib/filter.js +++ b/lib/filter.js @@ -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) { diff --git a/package.json b/package.json index 1c0d48a..fde2b96 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/test/fixture.html b/test/fixture.html index 226085d..22fa067 100644 --- a/test/fixture.html +++ b/test/fixture.html @@ -1,2 +1,3 @@ +
Hello World
\ No newline at end of file