mirror of https://github.com/jpanther/congo.git
Compare commits
1 Commits
3f12b1344b
...
b873587e99
Author | SHA1 | Date |
---|---|---|
stereobooster | b873587e99 |
|
@ -44,14 +44,14 @@
|
||||||
{{ $height := ""}}
|
{{ $height := ""}}
|
||||||
{{ if eq .MediaType.SubType "svg" }}
|
{{ if eq .MediaType.SubType "svg" }}
|
||||||
{{ $svgContent := $resource.Content }}
|
{{ $svgContent := $resource.Content }}
|
||||||
{{ range (findRESubmatch `<svg[^>]*width=["']([.0-9]*)["'a-zA-Z]` $svgContent 1) }}
|
{{ range (findRESubmatch `width=["']?(\d*)` $svgContent 1) }}
|
||||||
{{ $width = index . 1 }}
|
{{ $width = index . 1 }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ range (findRESubmatch `<svg[^>]*height=["']([.0-9]*)["'a-zA-Z]` $svgContent 1) }}
|
{{ range (findRESubmatch `height=["']?(\d*)` $svgContent 1) }}
|
||||||
{{ $height = index . 1 }}
|
{{ $height = index . 1 }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if (eq "" $width $height) }}
|
{{ if (eq "" $width $height) }}
|
||||||
{{ range (findRESubmatch `<svg[^>]*viewBox=["']?([.0-9]*) ([.0-9]*) ([.0-9]*) ([.0-9]*)` $svgContent 1) }}
|
{{ range (findRESubmatch `viewBox=["']?(\d*) (\d*) (\d*) (\d*)` $svgContent 1) }}
|
||||||
{{ $width = index . 3 }}
|
{{ $width = index . 3 }}
|
||||||
{{ $height = index . 4 }}
|
{{ $height = index . 4 }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in New Issue