773ea4cf1cfaea82dc7f18096542edf67f5ee3157c5eba9b2e4bc43a0c3e7b58da8368ff42f7994ed18cdf81ddb4439b8d26cca5bde48bf34f502a1769b718 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. 'use strict';
  2. exports.type = 'perItem';
  3. exports.active = true;
  4. exports.description = 'removes doctype declaration';
  5. /**
  6. * Remove DOCTYPE declaration.
  7. *
  8. * "Unfortunately the SVG DTDs are a source of so many
  9. * issues that the SVG WG has decided not to write one
  10. * for the upcoming SVG 1.2 standard. In fact SVG WG
  11. * members are even telling people not to use a DOCTYPE
  12. * declaration in SVG 1.0 and 1.1 documents"
  13. * https://jwatt.org/svg/authoring/#doctype-declaration
  14. *
  15. * @example
  16. * <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
  17. * q"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
  18. *
  19. * @example
  20. * <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  21. * "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
  22. * <!-- an internal subset can be embedded here -->
  23. * ]>
  24. *
  25. * @param {Object} item current iteration item
  26. * @return {Boolean} if false, item will be filtered out
  27. *
  28. * @author Kir Belevich
  29. */
  30. exports.fn = function(item) {
  31. if (item.doctype) {
  32. return false;
  33. }
  34. };