Add missing uses of safeHTML

master
Will Faught 2 years ago
parent f410b73b24
commit 173872ea26

@ -5,11 +5,11 @@
{{- $page.Scratch.Add "paige_index" (dict
"categories" .Params.categories
"date" .PublishDate
"description" (.Description | markdownify | plainify | htmlUnescape)
"description" (.Description | markdownify | plainify | htmlUnescape | safeHTML)
"keywords" .Params.keywords
"link" .RelPermalink
"tags" .Params.tags
"text" (strings.TrimRight " " (replace (.Plain | htmlUnescape) "\n" " "))
"title" (.Title | markdownify | plainify | htmlUnescape)) -}}
"text" (strings.TrimRight " " (replace (.Plain | htmlUnescape | safeHTML) "\n" " "))
"title" (.Title | markdownify | plainify | htmlUnescape | safeHTML)) -}}
{{- end -}}
{{- $page.Scratch.Get "paige_index" | jsonify -}}

@ -8,7 +8,7 @@
<ul class="list-inline text-center">
{{ range (sort . "Title") }}
<li class="list-inline-item">
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
<a href="{{ .RelPermalink }}">{{ .Title | markdownify | safeHTML }}</a>
</li>
{{ end }}
</ul>

@ -50,7 +50,7 @@
{{ if .Content }}
<description>{{ printf "<![CDATA[%s]]>" .Content | safeHTML }}</description>
{{ else if .Description }}
<description>{{ .Description | markdownify | html }}</description>
<description>{{ .Description | markdownify | safeHTML }}</description>
{{ end }}
{{ with .Permalink }}
<guid>{{ . }}</guid>
@ -60,7 +60,7 @@
<pubDate>{{ .Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</pubDate>
{{ end }}
{{ with .Title }}
<title>{{ . | markdownify | plainify | htmlUnescape }}</title>
<title>{{ . | markdownify | plainify | htmlUnescape | safeHTML }}</title>
{{ end }}
</item>
{{ end }}

@ -2,8 +2,8 @@
{{ with $page.Param "paige.alert" }}
{{ if reflect.IsMap . }}
<div class="alert alert-{{ .type }}" role="alert">{{ .message | markdownify }}</div>
<div class="alert alert-{{ .type }}" role="alert">{{ .message | markdownify | safeHTML }}</div>
{{ else }}
<div class="alert alert-primary" role="alert">{{ . | markdownify }}</div>
<div class="alert alert-primary" role="alert">{{ . | markdownify | safeHTML }}</div>
{{ end }}
{{ end }}

@ -5,7 +5,7 @@
<div class="d-flex justify-content-center">
<ol class="breadcrumb mb-0">
{{ range .Reverse }}
<li class="breadcrumb-item"><a href="{{ .RelPermalink }}">{{ .Title | markdownify}}</a></li>
<li class="breadcrumb-item"><a href="{{ .RelPermalink }}">{{ .Title | markdownify | safeHTML }}</a></li>
{{ end }}
</ol>
</div>

@ -5,7 +5,7 @@
{{ partial "paige/footer-first.html" . }}
{{ end }}
{{ with site.Copyright | markdownify }}
{{ with site.Copyright | markdownify | safeHTML }}
<p class="mb-0 text-center text-secondary" id="paige-copyright">{{ . }}</p>
{{ end }}

@ -5,12 +5,12 @@
{{ $commiturl := "" }}
{{ $date := $page.PublishDate }}
{{ $dateformat := $page.Param "paige.date.format" | default ":date_long" }}
{{ $description := $page.Description | markdownify }}
{{ $description := $page.Description | markdownify | safeHTML }}
{{ $link := $page.Params.link }}
{{ $readingtime := $page.ReadingTime }}
{{ $series := $page.Params.series }}
{{ $tags := $page.Params.tags | default slice | uniq }}
{{ $title := $page.Title | markdownify }}
{{ $title := $page.Title | markdownify | safeHTML }}
{{ if and ($page.Param "paige.git.commit_url") $page.GitInfo }}
{{ $commiturl = printf ($page.Param "paige.git.commit_url") $page.GitInfo.Hash }}

@ -5,7 +5,7 @@
{{ $commiturl := "" }}
{{ $date := $page.PublishDate }}
{{ $dateformat := $page.Param "paige.date.format" | default ":date_long" }}
{{ $description := $page.Description | markdownify }}
{{ $description := $page.Description | markdownify | safeHTML }}
{{ $draft := $page.Draft }}
{{ $expired := and $page.ExpiryDate (lt $page.ExpiryDate now) }}
{{ $flags := slice }}
@ -14,9 +14,9 @@
{{ $pinned := $page.Params.paige.pin }}
{{ $readingtime := $page.ReadingTime }}
{{ $series := $page.Params.series }}
{{ $summary := $page.Summary | htmlUnescape | plainify }}
{{ $summary := $page.Summary | plainify | htmlUnescape | safeHTML }}
{{ $tags := $page.Params.tags | default slice | uniq }}
{{ $title := $page.Title | markdownify }}
{{ $title := $page.Title | markdownify | safeHTML }}
{{ $titlelink := $page.RelPermalink }}
{{ if and (.Param "paige.git.commit_url") .GitInfo }}

@ -1,8 +1,8 @@
{{ $page := . }}
{{ $pagetitle := $page.Title | markdownify | plainify | htmlUnescape }}
{{ $pagetitle := $page.Title | markdownify | plainify | htmlUnescape | safeHTML }}
{{ $result := "" }}
{{ $sitetitle := site.Title | markdownify | plainify | htmlUnescape }}
{{ $sitetitle := site.Title | markdownify | plainify | htmlUnescape | safeHTML }}
{{ if and $pagetitle $sitetitle }}
{{ if .IsHome }}

@ -1,5 +1,5 @@
{{ $caption := .Get 0 | default (.Get "caption") | markdownify }}
{{ $content := .Inner | markdownify }}
{{ $caption := .Get 0 | default (.Get "caption") | markdownify | safeHTML }}
{{ $content := .Inner | markdownify | safeHTML }}
{{ $float := .Get "float" }}
{{ $horizontal := .Get "horizontal" | default "center" }}
{{ $maxwidth := .Get "maxwidth" }}

@ -1,5 +1,5 @@
{{ $cite := .Get 0 | default (.Get "cite") }}
{{ $content := .Inner | replaceRE "^\n" "" | replaceRE "\n$" "" | markdownify }}
{{ $content := .Inner | replaceRE "^\n" "" | replaceRE "\n$" "" | markdownify | safeHTML }}
{{ if not $content }}
{{ errorf "layouts/shortcodes/paige/quote.html: no content" }}

Loading…
Cancel
Save