Core

/views/components/fieldview/String.html (292 B)

 1
2
3
4
5
6
7
8
9
10
11
12
13
{% import (
"strings"
) %}

{% func String(v string) %}{% stripspace %}
{% if len(v) == 0 %}
<em>empty string</em>
{% elseif strings.Contains(v, "\n") %}
<div class="pre">{%s strings.TrimSpace(v) %}</div>
{% else %}
{%s v %}
{% endif %}
{% endstripspace %}{% endfunc %}