0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-12 10:09:03 -05:00

🐛 Fixes problem when exporting svg's

This commit is contained in:
alonso.torres 2021-04-09 14:05:32 +02:00
parent 4e1d85a5f4
commit 080dd88509

View file

@ -65,7 +65,7 @@
(defn ^boolean empty-path-element?
[item]
(and (= (get item "name") "path")
(let [d (get item ["attributes" "d"])]
(let [d (get-in item ["attributes" "d"])]
(or (str/blank? d)
(nil? d)
(str/empty? d)))))
@ -93,16 +93,7 @@
item))
(process-element [item xform]
(let [item (d/update-when item "elements" #(into [] xform %))]
(if (shape-element? item)
(update item "elements"
(fn [elements]
;; flatten content of a shape element
(into [] (mapcat (fn [item]
(if (group-element? item)
(get item "elements")
[item]))) elements)))
item)))]
(d/update-when item "elements" #(into [] xform %)))]
(let [xform (comp (remove empty-defs-element?)
(remove empty-path-element?)