🐛 Fix: don't display external icon when links has icon suffix (#96)

This commit is contained in:
Cell
2022-04-12 11:45:24 +08:00
parent 8115059109
commit 8ad74ede2f
+5 -1
View File
@@ -31,7 +31,11 @@
{{- with .Content -}}
{{- . | safeHTML -}}
{{- end -}}
{{- if (.ExternalIcon | default false) | and $external | and (eq (hasPrefix .Content `<img` ) false) }}
{{- if
(.ExternalIcon | default false)
| and $external | and (eq (hasPrefix .Content `<img` ) false)
| and (eq ((strings.HasSuffix .Content `</i>`) | or (strings.HasSuffix .Content `):`)) false)
}}
{{ if .Download }}
{{ dict "Class" "fas fa-cloud-download-alt fa-fw fa-xs" | partial "plugin/icon.html" }}
{{- else -}}