diff --git a/scour/scour.py b/scour/scour.py index 742658c..813204a 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -593,8 +593,6 @@ def findReferencedElements(node, ids=None): # now get all style properties and the fill, stroke, filter attributes styles = node.getAttribute('style').split(';') - for attr in referencingProps: - styles.append(':'.join([attr, node.getAttribute(attr)])) for style in styles: propval = style.split(':') @@ -603,6 +601,12 @@ def findReferencedElements(node, ids=None): val = propval[1].strip() findReferencingProperty(node, prop, val, ids) + for attr in referencingProps: + val = node.getAttribute(attr).strip() + if not val: + continue + findReferencingProperty(node, attr, val, ids) + if node.hasChildNodes(): for child in node.childNodes: if child.nodeType == Node.ELEMENT_NODE: