22var got = require ( 'got' ) ;
33var cheerio = require ( 'cheerio' ) ;
44var uncss = require ( 'uncss' ) ;
5- var tempWrite = require ( 'temp-write' ) ;
65
76function getCss ( cb ) {
87 got ( 'https://github.com' , function ( err , data ) {
@@ -26,14 +25,17 @@ function getCss(cb) {
2625}
2726
2827function getRenderedFixture ( cb ) {
29- got ( 'https://github.com/sindresorhus/github-markdown-css/blob/gh-pages/fixture.md' , function ( err , data ) {
28+ var url = 'https://github.com/sindresorhus/github-markdown-css/blob/gh-pages/fixture.md' ;
29+
30+ got ( url , function ( err , data ) {
3031 if ( err ) {
3132 return cb ( err ) ;
3233 }
3334
3435 var $ = cheerio . load ( data ) ;
36+ var html = $ ( '.markdown-body' ) . parent ( ) . html ( ) ;
3537
36- cb ( null , tempWrite . sync ( $ ( '.markdown-body' ) . parent ( ) . html ( ) ) ) ;
38+ cb ( null , html ) ;
3739 } ) ;
3840}
3941
@@ -99,7 +101,7 @@ function cleanupCss(str) {
99101}
100102
101103module . exports = function ( cb ) {
102- getRenderedFixture ( function ( err , fixture ) {
104+ getRenderedFixture ( function ( err , html ) {
103105 if ( err ) {
104106 return cb ( err ) ;
105107 }
@@ -109,7 +111,7 @@ module.exports = function (cb) {
109111 return cb ( err ) ;
110112 }
111113
112- uncss ( [ fixture ] , {
114+ uncss ( html , {
113115 stylesheets : stylesheets ,
114116 ignore : [ / ^ \. h i g h l i g h t / ]
115117 } , function ( err , css ) {
0 commit comments