gulp-html2md

Removes unneeded whitespaces, line-breaks, comments, etc from HTML

gulp-html2md

Cleans your HTML using html-md

First, install gulp-html2md as a development dependency:

npm install --save-dev gulp-html2md

Then, add it to your gulpfile.js:

var html2md = require('gulp-html2md');
 
gulp.task('default', function(){
  gulp.src('index.html')
    .pipe(html2md())
    .pipe(gulp.dest('build'));
});

The above will convert index.html to index.md!