diff options
author | Robert Kaussow <mail@thegeeklab.de> | 2022-02-07 16:47:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-07 16:47:32 +0300 |
commit | 87fdde4808d612a7a91accd7308c0815184ef9f6 (patch) | |
tree | b30b90e44553d85c631fa6e1ff04aab534fd6a31 | |
parent | cd9ab9e48ef48b0435431d771aa0a155ae3126fa (diff) |
fix: use safeHTML for description in metadata (#334)v0.26.1
-rw-r--r-- | layouts/partials/head/meta.html | 2 | ||||
-rw-r--r-- | layouts/partials/microformats/opengraph.html | 2 | ||||
-rw-r--r-- | layouts/partials/microformats/schema.html | 4 | ||||
-rw-r--r-- | layouts/partials/microformats/twitter_cards.html | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/layouts/partials/head/meta.html b/layouts/partials/head/meta.html index 761fe1c..4cc4ddb 100644 --- a/layouts/partials/head/meta.html +++ b/layouts/partials/head/meta.html @@ -7,7 +7,7 @@ {{ $keywords := default .Site.Params.Keywords .Keywords }} {{- with partial "utils/description" . }} - <meta name="description" content="{{ trim (. | plainify) "\n" }}" /> + <meta name="description" content="{{ trim (. | plainify) "\n" | safeHTML }}" /> {{- end }} {{- with $keywords }} <meta name="keywords" content="{{ delimit . "," }}" /> diff --git a/layouts/partials/microformats/opengraph.html b/layouts/partials/microformats/opengraph.html index 1065cb9..bd4b5a9 100644 --- a/layouts/partials/microformats/opengraph.html +++ b/layouts/partials/microformats/opengraph.html @@ -5,7 +5,7 @@ <meta property="og:site_name" content="{{ . }}" /> {{- end }} {{- with partial "utils/description" . }} - <meta property="og:description" content="{{ trim (. | plainify) "\n" }}" /> + <meta property="og:description" content="{{ trim (. | plainify) "\n" | safeHTML }}" /> {{- end }} <meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" /> <meta property="og:url" content="{{ .Permalink }}" /> diff --git a/layouts/partials/microformats/schema.html b/layouts/partials/microformats/schema.html index c610c70..9175cef 100644 --- a/layouts/partials/microformats/schema.html +++ b/layouts/partials/microformats/schema.html @@ -8,7 +8,7 @@ "name": "{{ .Site.Title }}", "url": "{{ .Site.BaseURL }}", {{- with partial "utils/description" . }} - "description": "{{ trim (. | plainify) "\n" }}", + "description": "{{ trim (. | plainify) "\n" | safeHTML }}", {{- end }} "thumbnailUrl": "{{ $thumbnail }}" {{- with .Site.Params.GeekdocContentLicense }}, @@ -26,7 +26,7 @@ "headline": "{{ (partial "utils/title" .) | safeJS }}", "alternativeHeadline": "{{ .Params.lead }}", {{- with partial "utils/description" . }} - "description": "{{ trim (. | plainify) "\n" }}", + "description": "{{ trim (. | plainify) "\n" | safeHTML }}", {{- end }} "inLanguage": {{ .Site.Language.Lang }}, "isFamilyFriendly": "true", diff --git a/layouts/partials/microformats/twitter_cards.html b/layouts/partials/microformats/twitter_cards.html index 55097be..86f96d4 100644 --- a/layouts/partials/microformats/twitter_cards.html +++ b/layouts/partials/microformats/twitter_cards.html @@ -21,7 +21,7 @@ {{- end }} <meta name="twitter:title" content="{{ partial "utils/title" . }}" /> {{- with partial "utils/description" . }} - <meta name="twitter:description" content="{{ trim (. | plainify) "\n" }}" /> + <meta name="twitter:description" content="{{ trim (. | plainify) "\n" | safeHTML }}" /> {{- end }} {{- with .Site.Social.twitter -}} <meta name="twitter:site" content="@{{ . }}" /> |