mirror of
https://github.com/exyte/Macaw.git
synced 2024-10-26 13:01:25 +03:00
SVGParser will parse the class
attribute as Node Tag.
This commit is contained in:
parent
d508348111
commit
01fadbb828
@ -897,8 +897,15 @@ open class SVGParser {
|
||||
}
|
||||
|
||||
fileprivate func getTag(_ element: XMLHash.XMLElement) -> [String] {
|
||||
let id = element.allAttributes["id"]?.text
|
||||
return id.map { [$0] } ?? []
|
||||
var result: [String] = []
|
||||
if let id = element.allAttributes["id"]?.text {
|
||||
result.append(id)
|
||||
}
|
||||
if let classes = element.allAttributes["class"]?.text.split(separator: " ").map({ String($0) }) {
|
||||
result.append(contentsOf: classes)
|
||||
}
|
||||
|
||||
return Array(Set(result))
|
||||
}
|
||||
|
||||
fileprivate func getOpacity(_ styleParts: [String: String]) -> Double {
|
||||
|
Loading…
Reference in New Issue
Block a user