You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
558 B

4 years ago
  1. 'use strict';
  2. exports.type = 'perItem';
  3. exports.active = false;
  4. exports.description = 'removes raster images (disabled by default)';
  5. /**
  6. * Remove raster images references in <image>.
  7. *
  8. * @see https://bugs.webkit.org/show_bug.cgi?id=63548
  9. *
  10. * @param {Object} item current iteration item
  11. * @return {Boolean} if false, item will be filtered out
  12. *
  13. * @author Kir Belevich
  14. */
  15. exports.fn = function(item) {
  16. if (
  17. item.isElem('image') &&
  18. item.hasAttrLocal('href', /(\.|image\/)(jpg|png|gif)/)
  19. ) {
  20. return false;
  21. }
  22. };