From 056ff3230698a3bec8ab75897b2085032b513b3a Mon Sep 17 00:00:00 2001 From: Alexander Bilz Date: Thu, 26 Dec 2024 14:16:14 +0100 Subject: [PATCH] fix: unsafe html warnings (#531) --- exampleSite/config/_default/hugo.toml | 2 +- layouts/_default/rss.xml | 4 ++-- layouts/index.html | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/exampleSite/config/_default/hugo.toml b/exampleSite/config/_default/hugo.toml index 890025d1..0f4e9880 100644 --- a/exampleSite/config/_default/hugo.toml +++ b/exampleSite/config/_default/hugo.toml @@ -25,7 +25,7 @@ localizedDates = false [markup] [markup.goldmark] [markup.goldmark.renderer] - unsafe=true + unsafe=false [taxonomies] category = "categories" diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index b9268758..0a52ebc7 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -33,11 +33,11 @@ {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} {{ .Permalink }} {{ if eq .Site.Params.rssFullContent true }} - {{ .Content | html }} + {{ .Content | safeHTML }} {{ else if .Description }} {{ .Description }} {{ else }} - {{ .Summary | html }} + {{ .Summary | safeHTML }} {{ end }} {{ end }} diff --git a/layouts/index.html b/layouts/index.html index fef6fc38..e3ff8266 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -55,9 +55,9 @@

{{ .Title }}

{{ upper .Title }}

{{ end }} {{ if .Site.Params.fullPostContent }} -

{{ .Content | markdownify }}

+

{{ .Content | safeHTML }}

{{ else }} -

{{ .Summary | markdownify }}

+

{{ .Summary | safeHTML }}

{{ end }} {{- if and (.Truncated) (.Site.Params.readMore) -}}