项目原始demo,不改动
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。

1234567891011121314151617181920212223242526272829
  1. 'use strict';
  2. exports.type = 'perItem';
  3. exports.active = true;
  4. exports.description = 'removes empty attributes';
  5. /**
  6. * Remove attributes with empty values.
  7. *
  8. * @param {Object} item current iteration item
  9. * @return {Boolean} if false, item will be filtered out
  10. *
  11. * @author Kir Belevich
  12. */
  13. exports.fn = function(item) {
  14. if (item.elem) {
  15. item.eachAttr(function(attr) {
  16. if (attr.value === '') {
  17. item.removeAttr(attr.name);
  18. }
  19. });
  20. }
  21. };