Skip to content

[#1034] Sanitizer guide and demo - #1039

Open
jamesnw wants to merge 4 commits into
mainfrom
sanitizing-untrusted-html-guide
Open

[#1034] Sanitizer guide and demo#1039
jamesnw wants to merge 4 commits into
mainfrom
sanitizing-untrusted-html-guide

Conversation

@jamesnw

@jamesnw jamesnw commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Addresses #685
Fixes #1034

@jamesnw
jamesnw requested a review from rowan-m as a code owner July 27, 2026 13:48
@rowan-m

rowan-m commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@jamesnw should this include an expectations.md at this point?

@rowan-m

rowan-m commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@jamesnw I'm wondering if this guide should:

  1. Cover the less common scenario where you use setHTMLUnsafe with Sanitizer.
  2. Mention Trusted Types as a way of auditing for untrusted input where you might then use Sanitizer.

However, I'm definitely posing these as open questions as I'm not immediately sure that 1. is common enough to merit adding (or maybe it's just a mention in the "Using Custom Sanitizer Configurations" section and 2. possibly makes more sense the other way round, that the Trusted Types guide should refer to Sanitizer. (https://developer.mozilla.org/en-US/docs/Web/API/HTML_Sanitizer_API#sanitization_and_trusted_types)

@jamesnw

jamesnw commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

@jamesnw should this include an expectations.md at this point?

Added, sorry!

@jamesnw I'm wondering if this guide should:

1. Cover the less common scenario where you use `setHTMLUnsafe` with `Sanitizer`.

2. Mention Trusted Types as a way of auditing for untrusted input where you might then use Sanitizer.

However, I'm definitely posing these as open questions as I'm not immediately sure that 1. is common enough to merit adding (or maybe it's just a mention in the "Using Custom Sanitizer Configurations" section and 2. possibly makes more sense the other way round, that the Trusted Types guide should refer to Sanitizer. (https://developer.mozilla.org/en-US/docs/Web/API/HTML_Sanitizer_API#sanitization_and_trusted_types)

I added #1. In the Trusted Types PR I just opened, I refer to Sanitizer. Let me know if you think that's sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create guide and evals for the sanitize-untrusted-html use case

2 participants