From f56843acc003ba3bbf71880d1780a9d94974f67a Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Wed, 2 Sep 2020 17:03:36 +0000 Subject: [PATCH] mergeSiblingGroupsWithCommonAttributes: Avoid creating "empty" -tags (#261) Closes: #260 Signed-off-by: Niels Thykier --- scour/scour.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scour/scour.py b/scour/scour.py index a5559c6..f462dc8 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -1158,6 +1158,9 @@ def mergeSiblingGroupsWithCommonAttributes(elem): i -= 1 continue attributes = {a.nodeName: a.nodeValue for a in currentNode.attributes.values()} + if not attributes: + i -= 1 + continue runStart, runEnd = i, i runElements = 1 while runStart > 0: