option minify
This commit is contained in:
parent
e95b8d897f
commit
eb35239fde
|
@ -609,9 +609,11 @@ class Article extends ArticleStub {
|
||||||
this.transformLink( elem )
|
this.transformLink( elem )
|
||||||
})
|
})
|
||||||
// map area links
|
// map area links
|
||||||
dom( 'area' ).each( (i, elem) => {
|
if ( dom( 'map' ).length > 0 ) {
|
||||||
this.transformLink( elem )
|
dom( 'area' ).each( (i, elem) => {
|
||||||
})
|
this.transformLink( elem )
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
let done = dom( 'img' ).toArray().map( elem => this.saveImage( elem ))
|
let done = dom( 'img' ).toArray().map( elem => this.saveImage( elem ))
|
||||||
done = done.concat( dom( '[style*="url("]' ).toArray().map( elem => this.transformStyle( elem )))
|
done = done.concat( dom( '[style*="url("]' ).toArray().map( elem => this.transformStyle( elem )))
|
||||||
|
@ -625,18 +627,19 @@ class Article extends ArticleStub {
|
||||||
log( err )
|
log( err )
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
try {
|
if ( command.minify ) {
|
||||||
out = minify( out, {
|
try {
|
||||||
collapseWhitespace: true,
|
out = minify( out, {
|
||||||
conservativeCollapse: true,
|
collapseWhitespace: true,
|
||||||
decodeEntities: true,
|
conservativeCollapse: true,
|
||||||
sortAttributes: true,
|
decodeEntities: true,
|
||||||
sortClassName: true,
|
sortAttributes: true,
|
||||||
removeComments: true,
|
sortClassName: true,
|
||||||
html5: false,
|
removeComments: true,
|
||||||
})
|
})
|
||||||
} catch ( err ) {
|
} catch ( err ) {
|
||||||
log( 'minify', err )
|
log( 'minify', err )
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
@ -1318,6 +1321,7 @@ function main () {
|
||||||
.option( '--template [file]', 'non-standard article template' )
|
.option( '--template [file]', 'non-standard article template' )
|
||||||
.option( '--style [file or CSS]', 'additional article CSS style' )
|
.option( '--style [file or CSS]', 'additional article CSS style' )
|
||||||
.option( '--no-default-style', "don't use default CSS style" )
|
.option( '--no-default-style', "don't use default CSS style" )
|
||||||
|
.option( '--no-minify', "don't minify articles" )
|
||||||
.option( '--no-images', "don't download images" )
|
.option( '--no-images', "don't download images" )
|
||||||
.option( '--no-css', "don't page styling" )
|
.option( '--no-css', "don't page styling" )
|
||||||
.option( '--no-pages', "don't save downloaded pages" )
|
.option( '--no-pages', "don't save downloaded pages" )
|
||||||
|
|
Loading…
Reference in New Issue
Block a user