mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-05-15 11:59:39 +03:00
Add a param shortcode to work around the escaped characters in hashes
This commit is contained in:
committed by
XhmikosR
parent
2bd3bd842d
commit
f979307833
@@ -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 -}}
|
||||
Reference in New Issue
Block a user