removeRasterImages.js 558 B

12345678910111213141516171819202122232425262728
  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. };