{{- $text := default "mark" (.Get "text" | default (.Get 0)) -}}
{{- $title := default "highlighted text" (.Get "title" | default (.Get 1)) -}}
{{- $id := default "" (.Get "id" | default (.Get 2)) -}}
{{- if gt (len .Inner) 1 -}}
{{- $text = trim .Inner "\n" -}}
{{- end -}}
{{- if $id -}}
{{- $id = print "mark:" (truncate 30 "" $text | anchorize | replaceRE `\d` "") -}}
{{- $id = printf `id=%q` $id -}}
{{- end -}}
{{- $text | markdownify -}}
{{- /* This comment removes trailing newlines and white spaces. */ -}}