Merge commit 'f96384a3b596f9bc0a3a035970b09b2c601f0ccb'

This commit is contained in:
Bjørn Erik Pedersen
2023-05-22 16:47:07 +02:00
341 changed files with 3107 additions and 4238 deletions

View File

@@ -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>` &rarr; `<p style="color: red;">…</p>`</span>
* <span class="bad">`<p style="{{ .Params.style }}">…</p>` &rarr; `<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 %}}