{% if field.value matches '{^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$}' %}
{% else %} {{ field.value|slice(0, 128)|striptags|raw }} {% endif %}