{{- $funcName := index globalCtx "funcName" -}}
{{- $predicate := index globalCtx "predicate" -}}
{{- $quotedPredicate := bquote $predicate -}}

{{- range . -}}
	{{- if eq .Kind "text" -}}
		{{- escape .Text | replace $funcName $quotedPredicate -}}
	{{- else if eq .Kind "rawText" -}}
		{{- .Text | replace $funcName $quotedPredicate -}}
	{{- else if eq .Kind "autolink" -}}
		{{- .Text | replace $funcName $quotedPredicate -}}
	{{- else if eq .Kind "link" -}}
		{{- link (escape .Text) .URL -}}
	{{- end -}}
{{- end -}}
