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 5683c0c commit 05fe60bCopy full SHA for 05fe60b
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*(?:(<!--.*?-->|<!DOCTYPE\s+svg[\s:]+.*?>)\s*)*<svg[\s>]`)
39
-var svgTagInXMLRegex = regexp.MustCompile(`(?si)\A<\?xml\b.*?\?>\s*(?:(<!--.*?-->|<!DOCTYPE\s+svg[\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