{{- if hasPrefix .Destination "mailto:" -}} {{- $text := replace (replace .Text "-" "--") "_" "__" -}} {{- else if hasPrefix .Destination "weixin:" -}} {{- $parsed := urls.Parse .Destination -}} {{- $title := .Title | default (printf "微信号:%s" $parsed.Host) -}} {{- .Text -}} {{- else -}} {{- .Text | replaceRE "^https?://(www\\.?)?" "" | replaceRE "^github\\.com\\/([^/]+)\\/([^/]+)\\/issues\\/(\\d+)" "$1/$2#$3" | replaceRE "#issuecomment-\\d+$" " (comment)" | replaceRE "^mtf-wiki/MtF-wiki#(\\d+)" "#$1" | safeHTML -}} {{- end -}}