{{ $contents := .Inner | htmlEscape -}} {{- $samp := false -}} {{- with .Attributes -}} {{- range $k, $v := . -}} {{- if strings.HasPrefix $k "var" -}} {{- $after := printf `%s` $v -}} {{- $contents = $contents | replaceRE $v $after -}} {{- else if strings.HasPrefix $k "str" -}} {{- $after := printf `%s` $v -}} {{- $contents = $contents | replaceRE $v $after -}} {{- else if strings.HasPrefix $k "trans" -}} {{- $after := printf `%s` $v -}} {{- $contents = $contents | replaceRE $v $after -}} {{- else if and (eq $k "samp")}} {{- $samp = $v -}} {{- end -}} {{- end -}} {{- end -}}
{{- if $samp -}}
{{- $contents | safeHTML -}}
{{- else -}}
{{- $contents | safeHTML -}}
{{- end -}}