Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions layouts/glossary/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@
{{ range $index, $term := . }}
{{ $term_str := printf "%s" $term }} <!-- Ensure $term is treated as a string -->
{{ $term_clean := replace $term_str "\u00a0" " " }} <!-- Replace non-breaking space with space -->
{{ $term_clean = replaceRE `[*\\]` "" $term_clean }} <!-- Drop Markdown emphasis and escapes (*p*-value) so the slug matches the title's -->
{{ $term_clean = replaceRE "\\s*\\(.*\\)" "" $term_clean }} <!-- Remove text in parentheses -->
{{ $term_clean = replace $term_clean " " "_" }} <!-- Replace spaces with underscores -->
{{ $term_clean = replaceRE "[^a-zA-Z0-9_]" "_" $term_clean }} <!-- Replace all non-alphanumeric characters with underscores -->
Expand All @@ -276,9 +277,9 @@
{{ end }}
{{ if $term_page }}
{{ $term_url := $term_page.RelPermalink }}
{{ $related_links = $related_links | append (printf "<a href='%s'>%s</a>" $term_url $term) }}
{{ $related_links = $related_links | append (printf "<a href='%s'>%s</a>" $term_url ($term_str | htmlEscape | markdownify)) }}
{{ else }}
{{ $related_links = $related_links | append $term }}
{{ $related_links = $related_links | append ($term_str | htmlEscape | markdownify | string) }}
{{ end }}
{{ end }}
{{ $related_links_string := delimit $related_links ", " | safeHTML }}
Expand Down
Loading