From 6d76766fc4aaf4e23ce3c5dfdf73e8ae8671a778 Mon Sep 17 00:00:00 2001 From: JSCHILL1 Date: Sun, 19 Apr 2009 08:12:42 -0500 Subject: [PATCH] Always keep ids on elements by default --- scour.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scour.py b/scour.py index f9d63d5..0195dda 100755 --- a/scour.py +++ b/scour.py @@ -201,14 +201,12 @@ numRastersEmbedded = 0 # returns the number of ID attributes removed def removeUnreferencedIDs(referencedIDs, identifiedElements): global numIDsRemoved + keepTags = ['font'] num = 0; for id in identifiedElements.keys(): node = identifiedElements[id] - if referencedIDs.has_key(id) == False : + if referencedIDs.has_key(id) == False and not node.nodeName in keepTags: node.removeAttribute('id') - # now remove the element from our list of elements with ids - # not necessary if we're calculating the array again every time -# del identifiedElements[id] numIDsRemoved += 1 num += 1 return num