{{- /* Resolve relative Markdown links (../section/page/index.md) to page
URLs, the same way the docs.docker.com link render hook resolves the
mounted copy of this content. refLinksErrorLevel is ERROR, so a link
to a missing page fails the build here before it breaks downstream.
Everything else (external, mailto, in-page anchors) passes through. */ -}}
{{- $url := .Destination -}}
{{- if or (strings.HasPrefix $url "http") (strings.HasPrefix $url "mailto:") (strings.HasPrefix $url "#") -}}
{{ .Text | safeHTML }}
{{- else if strings.Contains $url ".md" -}}
{{ .Text | safeHTML }}
{{- else -}}
{{ .Text | safeHTML }}
{{- end -}}