diff --git a/scour/scour.py b/scour/scour.py index 76f710d..8f0d532 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -1017,8 +1017,12 @@ def removeDescriptiveElements(doc, options): def g_tag_is_unmergeable(node): """Check if a tag can be merged or not - tags with a title or descriptions should generally be left alone. + Generally, there are two types of tags that should be left alone: + * tags with a title or descriptions + * tags that has an ID """ + if node.getAttribute('id') != '': + return True return any(True for n in node.childNodes if n.nodeType == Node.ELEMENT_NODE and n.nodeName in ('title', 'desc') and n.namespaceURI == NS['SVG'])