From d8cf17d7211c2d021425d9e4bc857655a3a91453 Mon Sep 17 00:00:00 2001 From: Kalashnikov Igor Date: Wed, 8 Jan 2014 21:29:41 +0400 Subject: [PATCH] + removeTitle plugin, disabled by default #159 --- plugins/removeTitle.js | 22 ++++++++++++++++++++++ test/plugins/removeTitle.01.svg | 10 ++++++++++ 2 files changed, 32 insertions(+) create mode 100644 plugins/removeTitle.js create mode 100644 test/plugins/removeTitle.01.svg diff --git a/plugins/removeTitle.js b/plugins/removeTitle.js new file mode 100644 index 00000000..3dd07f55 --- /dev/null +++ b/plugins/removeTitle.js @@ -0,0 +1,22 @@ +'use strict'; + +exports.type = 'perItem'; + +exports.active = false; + +/** + * Remove . + * Disabled by default cause it may be used for accessibility. + * + * https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title + * + * @param {Object} item current iteration item + * @return {Boolean} if false, item will be filtered out + * + * @author Igor Kalashnikov + */ +exports.fn = function(item) { + + return !item.isElem('title'); + +}; diff --git a/test/plugins/removeTitle.01.svg b/test/plugins/removeTitle.01.svg new file mode 100644 index 00000000..27b10ca0 --- /dev/null +++ b/test/plugins/removeTitle.01.svg @@ -0,0 +1,10 @@ +<svg xmlns="http://www.w3.org/2000/svg"> + <title>... + + + +@@@ + + + +