Quick fix for url() replacement in shortenIds: it should be url("#xyz") getting replaced, not url(#"xyz").
This commit is contained in:
parent
fdabe02701
commit
f2285145d6
1 changed files with 4 additions and 4 deletions
8
scour.py
8
scour.py
|
|
@ -648,8 +648,8 @@ def renameID(doc, idFrom, idTo, identifiedElements, referencedIDs):
|
||||||
styles = node.getAttribute('style')
|
styles = node.getAttribute('style')
|
||||||
if styles != '':
|
if styles != '':
|
||||||
newValue = styles.replace('url(#' + idFrom + ')', 'url(#' + idTo + ')')
|
newValue = styles.replace('url(#' + idFrom + ')', 'url(#' + idTo + ')')
|
||||||
newValue = newValue.replace("url(#'" + idFrom + "')", 'url(#' + idTo + ')')
|
newValue = newValue.replace("url('#" + idFrom + "')", 'url(#' + idTo + ')')
|
||||||
newValue = newValue.replace('url(#"' + idFrom + '")', 'url(#' + idTo + ')')
|
newValue = newValue.replace('url("#' + idFrom + '")', 'url(#' + idTo + ')')
|
||||||
node.setAttribute('style', newValue)
|
node.setAttribute('style', newValue)
|
||||||
num += len(styles) - len(newValue)
|
num += len(styles) - len(newValue)
|
||||||
|
|
||||||
|
|
@ -658,8 +658,8 @@ def renameID(doc, idFrom, idTo, identifiedElements, referencedIDs):
|
||||||
oldValue = node.getAttribute(attr)
|
oldValue = node.getAttribute(attr)
|
||||||
if oldValue != '':
|
if oldValue != '':
|
||||||
newValue = oldValue.replace('url(#' + idFrom + ')', 'url(#' + idTo + ')')
|
newValue = oldValue.replace('url(#' + idFrom + ')', 'url(#' + idTo + ')')
|
||||||
newValue = newValue.replace("url(#'" + idFrom + "')", 'url(#' + idTo + ')')
|
newValue = newValue.replace("url('#" + idFrom + "')", 'url(#' + idTo + ')')
|
||||||
newValue = newValue.replace('url(#"' + idFrom + '")', 'url(#' + idTo + ')')
|
newValue = newValue.replace('url("#' + idFrom + '")', 'url(#' + idTo + ')')
|
||||||
node.setAttribute(attr, newValue)
|
node.setAttribute(attr, newValue)
|
||||||
num += len(oldValue) - len(newValue)
|
num += len(oldValue) - len(newValue)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue