mirror of
https://github.com/penpot/penpot.git
synced 2025-01-22 14:39:45 -05:00
🐛 Fix edge cases on retrieving href-id on svg to shapes conversion
This commit is contained in:
parent
1b3e68f430
commit
0d5c1811cf
1 changed files with 10 additions and 2 deletions
|
@ -507,8 +507,16 @@
|
|||
att-refs (csvg/find-attr-references attrs)
|
||||
defs (get svg-data :defs)
|
||||
references (csvg/find-def-references defs att-refs)
|
||||
href-id (-> (or (:href attrs) (:xlink:href attrs) " ") (subs 1))
|
||||
use-tag? (and (= :use tag) (contains? defs href-id))]
|
||||
|
||||
href-id (or (:href attrs) (:xlink:href attrs) " ")
|
||||
href-id (if (and (string? href-id)
|
||||
(pos? (count href-id)))
|
||||
(subs href-id 1)
|
||||
href-id)
|
||||
|
||||
use-tag? (and (= :use tag)
|
||||
(some? href-id)
|
||||
(contains? defs href-id))]
|
||||
|
||||
(if use-tag?
|
||||
(let [;; Merge the data of the use definition with the properties passed as attributes
|
||||
|
|
Loading…
Add table
Reference in a new issue