enable using .Inner for complex text

This commit is contained in:
Marco Blessing 2021-04-15 11:47:33 +02:00 committed by GitHub
parent 6ce969bdcd
commit 0724988e4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,12 @@
<div class="alert alert-warning d-flex" role="alert"> <div class="alert alert-warning d-flex" role="alert">
<div class="flex-shrink-1 alert-icon">{{ with .Get "icon" }}{{.}}{{ end }}</div> <div class="flex-shrink-1 alert-icon">{{ with .Get "icon" }}{{.}} {{ end }}</div>
<div class="w-100">{{ with .Get "text" }}{{ . | safeHTML }}{{ end }}</div> {{ with .Get "text"}}
</div> <div class="w-100">{{ . }} </div>
{{ else }}
{{ with .Inner}}
<div class="w-100"> {{ . | markdownify}}</div>
{{ else }}
{{ errorf "No valid text variable or Inner content given"}}
{{ end }}
{{ end}}
</div>