0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-27 23:21:47 -05:00

Merge pull request #2744 from penpot/alotor-fix-svg-upload

🐛 Fix problem uploading svg with style tag
This commit is contained in:
Alejandro 2023-01-09 12:43:32 +01:00 committed by GitHub
commit 94fc067286
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 4 deletions

View file

@ -38,6 +38,7 @@
- Fix confirm group name with enter doesn't work in assets modal [Taiga #4506](https://tree.taiga.io/project/penpot/issue/4506)
- Fix group/ungroup shapes inside a component [Taiga #4052](https://tree.taiga.io/project/penpot/issue/4052)
- Fix wrong update of text in components [Taiga #4646](https://tree.taiga.io/project/penpot/issue/4646)
- Fix problem with SVG imports with style [#2605](https://github.com/penpot/penpot/issues/2605)
## 1.16.2-beta

View file

@ -110,7 +110,7 @@
(for [item childs]
[:& shape-wrapper {:shape item :key (dm/str (:id item))}])]
(and svg-leaf? valid-tag?)
svg-leaf?
content
:else nil))))

View file

@ -98,9 +98,17 @@
(and (some? active-frames)
(not (contains? active-frames (:id shape))))
opts #js {:shape shape :thumbnail? thumbnail?}]
opts #js {:shape shape :thumbnail? thumbnail?}
svg-leaf? (and (= :svg-raw (:type shape)) (string? (:content shape)))
[wrapper wrapper-props]
(if svg-leaf?
[mf/Fragment nil]
["g" #js {:className "workspace-shape-wrapper"}])]
(when (and (some? shape) (not (:hidden shape)))
[:g.workspace-shape-wrapper
[:> wrapper wrapper-props
(case (:type shape)
:path [:> path/path-wrapper opts]
:text [:> text/text-wrapper opts]

View file

@ -21,7 +21,7 @@
(defonce matrices-regex #"(matrix|translate|scale|rotate|skewX|skewY)\(([^\)]*)\)")
(defonce number-regex #"[+-]?\d*(\.\d+)?(e[+-]?\d+)?")
(defonce tags-to-remove #{:defs :linearGradient :radialGradient :metadata :mask :clipPath :filter :title})
(defonce tags-to-remove #{:linearGradient :radialGradient :metadata :mask :clipPath :filter :title})
;; https://www.w3.org/TR/SVG11/eltindex.html
(defonce svg-tags-list