mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Merge commit 'f96384a3b596f9bc0a3a035970b09b2c601f0ccb'
This commit is contained in:
@@ -1,20 +1,13 @@
|
||||
---
|
||||
title: safeCSS
|
||||
description: Declares the provided string as a known "safe" CSS string.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-26
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
parent: "functions"
|
||||
parent: functions
|
||||
keywords: [style,css,strings]
|
||||
signature: ["safeCSS INPUT"]
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: [safeHTML,safeHTMLAttr,]
|
||||
deprecated: false
|
||||
aliases: []
|
||||
---
|
||||
|
||||
In this context, *safe* means CSS content that matches any of the following:
|
||||
@@ -29,6 +22,6 @@ Example: Given `style = "color: red;"` defined in the front matter of your `.md`
|
||||
* <span class="good">`<p style="{{ .Params.style | safeCSS }}">…</p>` → `<p style="color: red;">…</p>`</span>
|
||||
* <span class="bad">`<p style="{{ .Params.style }}">…</p>` → `<p style="ZgotmplZ">…</p>`</span>
|
||||
|
||||
{{% note "ZgotmplZ" %}}
|
||||
{{% note %}}
|
||||
"ZgotmplZ" is a special value that indicates that unsafe content reached a CSS or URL context.
|
||||
{{% /note %}}
|
||||
|
Reference in New Issue
Block a user