Skip to content

othree/gulp-attr-remover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Remove element attribute if predicate is true

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published