aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRegis Philibert <[email protected]>2020-05-05 21:49:12 +0300
committerXhmikosR <[email protected]>2020-05-07 20:53:21 +0300
commitf9793078331a338c605edff963b54135c836b940 (patch)
tree1c65826efa4869f29edacea6a7ef87e6285f8df9
parent2bd3bd842d5ec67078a42f3d09ad240fa596979a (diff)
downloadbootstrap-f9793078331a338c605edff963b54135c836b940.tar.xz
bootstrap-f9793078331a338c605edff963b54135c836b940.zip
Add a param shortcode to work around the escaped characters in hashes
-rw-r--r--site/layouts/shortcodes/param.html12
1 files changed, 12 insertions, 0 deletions
diff --git a/site/layouts/shortcodes/param.html b/site/layouts/shortcodes/param.html
new file mode 100644
index 000000000..50e2060ae
--- /dev/null
+++ b/site/layouts/shortcodes/param.html
@@ -0,0 +1,12 @@
+{{- /*
+ Work around wrong escapes in integrity attributes.
+*/ -}}
+
+{{- $name := .Get 0 -}}
+{{- with $name -}}
+{{- $value := $.Page.Param . -}}
+{{- if in $name "_hash" -}}
+ {{- $value = $value | safeHTML -}}
+{{- end -}}
+{{- with $value }}{{ . }}{{ else }}{{ errorf "Param %q not found: %s" $name $.Position }}{{ end -}}
+{{- else }}{{ errorf "Missing param key: %s" $.Position }}{{ end -}}