// Usage example:
//
//    prune_html: {
//        templates: {
//            expand: true,
//            src: 'app/**/*.html',
//            dest: 'build/tmp/pruned_templates',
//        },
//        // filter is invoked with `this` as a cheerio object.
//        // You can use cheerio attributes: http://cheeriojs.github.io/cheerio/#attributes
//        options: {
//            filter: function () { return this.attr('prune') !== undefined; },
//        },
//    },
//
// ...
//
// grunt.loadNpmTasks('grunt-prune-html');
//

(function () {
    'use strict';

    module.exports = function (grunt) {

        grunt.registerMultiTask('prune_html', 'Prune HTML using the given filter function', function () {
            var filter = this.options().filter;

            // Returns the pruned HTML string, as well as the number of
            // DOM elements that were pruned.
            var prune = function (html) {
                var _prune = require('prune-html'),
                    count = 0;

                // If the given element is a prune, increment the number of prunes.
                // Return the input for chaining.
                var count_fn = function (is_prune) {
                    if (is_prune) count += 1;
                    return is_prune;
                };

                return { 
                    html: _prune(['*'], html, grunt.util._.compose(count_fn, filter)),
                    count: count,
                };
            };

            this.files.forEach(function (file) {
                file.src.forEach(function (filepath) {
                    var pruned = prune(grunt.file.read(filepath));

                    grunt.file.write(file.dest, pruned.html);

                    if (pruned.count) {
                        grunt.log.writeln('Pruned ' + pruned.count + ' elements from ' + file.dest);
                    }
                });
            });
        });

    };

})();

@@ -1,534 +1,4 @@
-// Usage example:%0A//%0A//    prune_html: %7B%0A//        templates: %7B%0A//            expand: true,%0A//            src: 'app/**/*.html',%0A//            dest: 'build/tmp/pruned_templates',%0A//        %7D,%0A//        // filter is invoked with %60this%60 as a cheerio object.%0A//        // You can use cheerio attributes: http://cheeriojs.github.io/cheerio/#attributes%0A//        options: %7B%0A//            filter: function () %7B return this.attr('prune') !== undefined; %7D,%0A//        %7D,%0A//    %7D,%0A//%0A// ...%0A//%0A// grunt.loadNpmTasks('grunt-prune-html');%0A//%0A%0A
 (fun

Remove duplicated doc