Skip to content

Commit

Permalink
SVG: fix bug in parting URL ID's, fixes #331
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Jan 20, 2025
1 parent 3165c39 commit 7f07dfd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions svg.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,11 +714,11 @@ func (svg *svgParser) setStyling(props []cssProperty) {
func (svg *svgParser) parseUrlID(val string) string {
if strings.HasPrefix(val, "url(") && strings.HasSuffix(val, ")") {
if 6 < len(val) && (val[4] == '#' || val[5] == '#') {
id := val[6 : len(val)-2]
if val[4] == '#' {
id = val[5 : len(val)-1]
return val[5 : len(val)-1]
} else {
return val[6 : len(val)-2]
}
return id
}
}
return ""
Expand Down

0 comments on commit 7f07dfd

Please sign in to comment.