Fix handling of SVG files without a viewBox element. (#4960)

This commit is contained in:
Martin Taillefer 2019-09-11 11:23:10 -07:00 committed by GitHub
parent 50a192392b
commit 2ef3b239ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ omit this value and it will be computed automatically.
{{- $w := 0.0 -}}
{{- $h := 0.0 -}}
{{- $viewBox := findRE "viewBox( *?)=( *?)\"(.*?)\"" $file 1 -}}
{{- if $viewBox -}}
{{- if eq (len $viewBox) 1 -}}
{{- $viewBox = index $viewBox 0 -}}
{{- $viewBox = index (findRE "[0123456789 \\.]+" $viewBox 1) 0 -}}
{{- $sizes := split $viewBox " " -}}