From ab49e362a7f76c370bf5e66a4fda087eb50a32e8 Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Mon, 7 Dec 2020 16:57:33 +0000 Subject: [PATCH] Add a callout for the sanitizer in popovers and tooltips (#32272) * Add a callout for the sanitizer in popovers and tooltips * Add second reference to sanitizer in the options Co-authored-by: XhmikosR --- site/content/docs/5.0/components/popovers.md | 6 +++++- site/content/docs/5.0/components/tooltips.md | 6 +++++- site/layouts/partials/callout-info-sanitizer.md | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 site/layouts/partials/callout-info-sanitizer.md diff --git a/site/content/docs/5.0/components/popovers.md b/site/content/docs/5.0/components/popovers.md index fb0f92f4a906..41b482d0316e 100644 --- a/site/content/docs/5.0/components/popovers.md +++ b/site/content/docs/5.0/components/popovers.md @@ -21,6 +21,10 @@ Things to know when using the popover plugin: - Popovers must be hidden before their corresponding elements have been removed from the DOM. - Popovers can be triggered thanks to an element inside a shadow DOM. +{{< callout info >}} +{{< partial "callout-info-sanitizer.md" >}} +{{< /callout >}} + {{< callout info >}} {{< partial "callout-info-prefersreducedmotion.md" >}} {{< /callout >}} @@ -275,7 +279,7 @@ Note that for security reasons the `sanitize`, `sanitizeFn`, and `allowList` opt sanitize boolean true - Enable or disable the sanitization. If activated 'template', 'content' and 'title' options will be sanitized. + Enable or disable the sanitization. If activated 'template', 'content' and 'title' options will be sanitized. See the }}">sanitizer section in our JavaScript documentation. allowList diff --git a/site/content/docs/5.0/components/tooltips.md b/site/content/docs/5.0/components/tooltips.md index e2a45c3edd69..6f02ac581785 100644 --- a/site/content/docs/5.0/components/tooltips.md +++ b/site/content/docs/5.0/components/tooltips.md @@ -20,6 +20,10 @@ Things to know when using the tooltip plugin: - Tooltips must be hidden before their corresponding elements have been removed from the DOM. - Tooltips can be triggered thanks to an element inside a shadow DOM. +{{< callout info >}} +{{< partial "callout-info-sanitizer.md" >}} +{{< /callout >}} + {{< callout info >}} {{< partial "callout-info-prefersreducedmotion.md" >}} {{< /callout >}} @@ -274,7 +278,7 @@ Note that for security reasons the `sanitize`, `sanitizeFn`, and `allowList` opt sanitize boolean true - Enable or disable the sanitization. If activated 'template' and 'title' options will be sanitized. + Enable or disable the sanitization. If activated 'template' and 'title' options will be sanitized. See the }}">sanitizer section in our JavaScript documentation. allowList diff --git a/site/layouts/partials/callout-info-sanitizer.md b/site/layouts/partials/callout-info-sanitizer.md new file mode 100644 index 000000000000..ee0eda48e5fb --- /dev/null +++ b/site/layouts/partials/callout-info-sanitizer.md @@ -0,0 +1 @@ +By default, this component uses the built-in content sanitizer, which strips out any HTML elements that are not explicitly allowed. See the [sanitizer section in our JavaScript documentation](/docs/{{ .Site.Params.docs_version }}/getting-started/javascript/#sanitizer) for more details.