From c27b545acbdc17efd6235d62210cd1d5d0672091 Mon Sep 17 00:00:00 2001 From: Ayooluwa Date: Sat, 12 Nov 2022 08:31:33 +0100 Subject: Improve explanation of safeHTMLAttr's function (#1503) Co-authored-by: Joe Mooring --- content/en/functions/safeHTMLAttr.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/content/en/functions/safeHTMLAttr.md b/content/en/functions/safeHTMLAttr.md index 19de2e985..17539d850 100644 --- a/content/en/functions/safeHTMLAttr.md +++ b/content/en/functions/safeHTMLAttr.md @@ -26,5 +26,13 @@ Example: Given a site-wide `config.toml` that contains this menu entry: url = "irc://irc.freenode.net/#golang" {{< /code-toggle >}} -* `` → `` -* `` → `` + +Attempting to use the `url` value directly in an attribute like this: + +- `` will produce the following: ``. + +The `ZgotmplZ` value indicates that you're trying to output content at a spot +where `template/html` deems to be unsafe. To correct the output, use the +`safeHTMLAttr` function like so: + +- `` which produces: `` -- cgit v1.2.3