{{- $rule := partial "content/link-policy.html" (dict "href" .href "page" .page) -}}
{{- $text := .text -}}
{{- with $rule.email.text_code -}}
{{- $address := $rule.email.address -}}
{{- $protected := printf `[email protected]` . -}}
{{- with $rule.email.standalone_href -}}
{{- $protected = printf `[email protected]` . $rule.email.text_code -}}
{{- end -}}
{{- $text = replace (string $text) $address $protected -}}
{{- end -}}
{{- if or $rule.excluded $rule.email.text_only -}}
{{- $text | safeHTML -}}
{{- else -}}
{{ $text | safeHTML }}
{{- end -}}