An open API service indexing awesome lists of open source software.

https://github.com/othree/gulp-attr-remover

Remove element attribute if predicate is true
https://github.com/othree/gulp-attr-remover

Last synced: 11 months ago
JSON representation

Remove element attribute if predicate is true

Awesome Lists containing this project

README

          

Remove element attribute if predicate is true

USAGE
-----

function predicate(elem) {
"use strict";
if (!/^((ftp|rtsp|mms):)?\/\//.test(elem.attr('href'))) {
return true;
}
return false;
}

gulp.task('default', function () {
"use strict";

gulp.src('./cases/*.html')
.pipe(modf('a', 'href', predicate))
.pipe(gulp.dest('./output'));
});

LICENSE
-------

MIT