项目原始demo,不改动
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
Este repositorio está archivado. Puede ver los archivos y clonarlo, pero no puede subir cambios o reportar incidencias ni pedir Pull Requests.

1234567891011121314151617181920212223242526272829303132
  1. 'use strict';
  2. exports.type = 'perItem';
  3. exports.active = true;
  4. exports.params = {
  5. removeAny: false
  6. };
  7. exports.description = 'removes <desc> (only non-meaningful by default)';
  8. var standardDescs = /^Created with/;
  9. /**
  10. * Removes <desc>.
  11. * Removes only standard editors content or empty elements 'cause it can be used for accessibility.
  12. * Enable parameter 'removeAny' to remove any description.
  13. *
  14. * https://developer.mozilla.org/en-US/docs/Web/SVG/Element/desc
  15. *
  16. * @param {Object} item current iteration item
  17. * @return {Boolean} if false, item will be filtered out
  18. *
  19. * @author Daniel Wabyick
  20. */
  21. exports.fn = function(item, params) {
  22. return !item.isElem('desc') || !(params.removeAny || item.isEmpty() ||
  23. standardDescs.test(item.content[0].text));
  24. };