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
- Host: GitHub
- URL: https://github.com/othree/gulp-attr-remover
- Owner: othree
- License: mit
- Created: 2015-03-30T03:57:32.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-30T06:11:18.000Z (about 11 years ago)
- Last Synced: 2024-04-27T13:40:18.782Z (about 2 years ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/gulp-attr-remover
- Size: 137 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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