lib/output/modifiers/modifyHTML.js
function modifyHTML(page, operations) {
    var html = page.getContent();
    var $ = cheerio.load(html);

    return Promise.forEach(operations, function(op) {
        return op($);
    })
    .then(function() {
        var resultHTML = $.html();
        return page.set('content', resultHTML);
    });
}
function modifyHTML(page, operations) {
    var html = page.getContent();
    var $ = cheerio.load(html);

    return Promise.forEach(operations, function(op) {
        return op($);
    })
    .then(function() {
        var resultHTML = $.html();
        return page.set('content', resultHTML);
    });
}
function modifyHTML ( page , operations ) { var html = page . getContent ( ) ; var $ = cheerio . load ( html ) ; return Promise . forEach ( operations , function ( op ) { return op ( $ ) ; } ) . then ( function ( ) { var resultHTML = $ . html ( ) ; return page . set ( 'content' , resultHTML ) ; } ) ; }
Apply a list of operations to a page and
output the new page.

@param {Page}
@param {List|Array<Transformation>}
@return {Promise<Page>}
Apply a list of operations to a page and output the new page .