0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-30 22:52:24 +01:00

Add a param shortcode to work around the escaped characters in hashes

This commit is contained in:
Regis Philibert 2020-05-05 21:49:12 +03:00 committed by XhmikosR
parent 2bd3bd842d
commit f979307833

View File

@ -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 -}}