We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ec15d9 commit eefd258Copy full SHA for eefd258
modules/base/tool.go
@@ -35,8 +35,8 @@ const sniffLen = 512
35
// SVGMimeType MIME type of SVG images.
36
const SVGMimeType = "image/svg+xml"
37
38
-var svgTagRegex = regexp.MustCompile(`(?si)\A\s*(?:<!--.*?-->\s*)*<svg[\s>]`)
39
-var svgTagInXMLRegex = regexp.MustCompile(`(?si)\A<\?xml\b.*?\?>\s*(?:<!--.*?-->\s*)*<svg[\s>]`)
+var svgTagRegex = regexp.MustCompile(`(?si)\A\s*(?:(<!--.*?-->|<!DOCTYPE\s+svg[\s:]+.*?>)\s*)*<svg[\s>]`)
+var svgTagInXMLRegex = regexp.MustCompile(`(?si)\A<\?xml\b.*?\?>\s*(?:(<!--.*?-->|<!DOCTYPE\s+svg[\s:]+.*?>)\s*)*<svg[\s>]`)
40
41
// EncodeMD5 encodes string to md5 hex value.
42
func EncodeMD5(str string) string {
0 commit comments