Fix ????s in interaction names

These arrive because webmentions.io can't cope with inbound emoji. Until that's fixed, this strips the ???s out at render time, to keep things looking nice.
This commit is contained in:
JP Hastings-Spital 2025-02-03 22:47:14 +00:00
parent 678b6a8540
commit db44af2e52

View file

@ -53,7 +53,7 @@
{{ continue }} {{ continue }}
{{ end }} {{ end }}
<li> <li>
<a href="{{.author.url}}">{{ .author.name }}</a>: {{ .comment }} <a href="{{.author.url}}">{{ .author.name | replaceRE `(\?\x{200D}?){2,}` "" | strings.TrimSpace }}</a>: {{ .comment }}
<span class="muted">(<a href="{{.url }}" target="_blank">{{ partial "rel-date.html" (dict "time" .timestamp "rel" $.Page.PublishDate) }}</a>)</span> <span class="muted">(<a href="{{.url }}" target="_blank">{{ partial "rel-date.html" (dict "time" .timestamp "rel" $.Page.PublishDate) }}</a>)</span>
</li> </li>
{{ end }} {{ end }}
@ -65,7 +65,7 @@
<li> <li>
{{ partial "partials/reactionsvg.html" (dict "emoji" $thisEm "name" true) -}} {{ partial "partials/reactionsvg.html" (dict "emoji" $thisEm "name" true) -}}
{{- range $i, $in := $items -}} {{- range $i, $in := $items -}}
<a href="{{ $in.url | default $in.author.url }}" target="_blank">{{ $in.author.name }}</a> <a href="{{ $in.url | default $in.author.url }}" target="_blank">{{ $in.author.name | replaceRE `(\?\x{200D}?){2,}` "" | strings.TrimSpace }}</a>
{{- if ne $i (sub (len $items) 1) }}, {{ end -}} {{- if ne $i (sub (len $items) 1) }}, {{ end -}}
{{- end -}} {{- end -}}
</li> </li>