aboutsummaryrefslogtreecommitdiffstats
path: root/modules/svg
diff options
context:
space:
mode:
Diffstat (limited to 'modules/svg')
-rw-r--r--modules/svg/svg.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/svg/svg.go b/modules/svg/svg.go
index e0f0a263f3..b74ee35358 100644
--- a/modules/svg/svg.go
+++ b/modules/svg/svg.go
@@ -25,6 +25,12 @@ const defaultSize = 16
// Init discovers SVGs and populates the `SVGs` variable
func Init() {
SVGs = Discover()
+
+ // Remove `xmlns` because inline SVG does not need it
+ r := regexp.MustCompile(`(<svg\b[^>]*?)\s+xmlns="[^"]*"`)
+ for name, svg := range SVGs {
+ SVGs[name] = r.ReplaceAllString(svg, "$1")
+ }
}
// Render render icons - arguments icon name (string), size (int), class (string)