Don't import elements declared within <metadata>

Some SVG files declare elements inside of the metadata block. Don’t
import them.
This commit is contained in:
Paul Kaplan 2015-04-28 16:12:50 -05:00
parent 25af154c32
commit 34d490c1a0

View file

@ -541,7 +541,7 @@
var elements = descendants.filter(function(el) {
reViewBoxTagNames.test(el.tagName) && addVBTransform(el, 0, 0);
return reAllowedSVGTagNames.test(el.tagName) &&
!hasAncestorWithNodeName(el, /^(?:pattern|defs|symbol)$/); // http://www.w3.org/TR/SVG/struct.html#DefsElement
!hasAncestorWithNodeName(el, /^(?:pattern|defs|symbol|metadata)$/); // http://www.w3.org/TR/SVG/struct.html#DefsElement
});
if (!elements || (elements && !elements.length)) {