image: only inline content if svg #1019

This commit is contained in:
Sören Weber 2025-02-15 03:41:15 +01:00
parent 0a3121be8f
commit 52e6df6cdf
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 3 additions and 3 deletions

View file

@ -63,11 +63,11 @@
{{- end }}
{{- end }}
{{- end }}
{{- if and .linkObject $effects.inlinecontent }}
{{- if and .linkObject $effects.inlinecontent (eq .linkObject.MediaType.Type "image/svg+xml") }}
{{- $content := .linkObject.Content | replaceRE `(?s)^\s*<\?.*?\?>\s*` "" }}
{{- $attributes = merge $attributes (dict "content" $content) }}
{{- else if and .linkObject $effects.dataurl }}
{{- $src := printf "data:%s;base64,%s" .linkObject.MediaType (.linkObject.Content | base64Encode) }}
{{- $src := printf "data:%s;base64,%s" .linkObject.MediaType.Type (.linkObject.Content | base64Encode) }}
{{- $attributes = merge $attributes (dict "src" $src) }}
{{- else }}
{{- $attributes = merge $attributes (dict "src" .url) }}

View file

@ -1 +1 @@
7.3.2+ad60ecdaa817b167fe3b06c421040a92717b367a
7.3.2+0a3121be8f0b49511eb20df9d2839e10a817fd75