From 9f9ddd69abbdf4409160121ac4d5ea872836a2f1 Mon Sep 17 00:00:00 2001 From: Xin Date: Wed, 26 Feb 2025 23:26:21 +0000 Subject: [PATCH] fix: sanitize heading title to prevent html tags displayed on mobile (#591) --- layouts/partials/sidebar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 6698f10..318d240 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -126,7 +126,7 @@ href="#{{ anchorize .ID }}" class="hx-flex hx-rounded hx-px-2 hx-py-1.5 hx-text-sm hx-transition-colors [word-break:break-word] hx-cursor-pointer [-webkit-tap-highlight-color:transparent] [-webkit-touch-callout:none] contrast-more:hx-border hx-gap-2 before:hx-opacity-25 before:hx-content-['#'] hx-text-gray-500 hover:hx-bg-gray-100 hover:hx-text-gray-900 dark:hx-text-neutral-400 dark:hover:hx-bg-primary-100/5 dark:hover:hx-text-gray-50 contrast-more:hx-text-gray-900 contrast-more:dark:hx-text-gray-50 contrast-more:hx-border-transparent contrast-more:hover:hx-border-gray-900 contrast-more:dark:hover:hx-border-gray-50" > - {{- .Title -}} + {{- .Title | safeHTML | plainify | htmlUnescape -}} {{ end -}}