You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tests only verify removal of onerror attributes but don’t cover other XSS vectors like <script> tags, javascript: URIs, or inline event handlers. Add tests for broader sanitization edge cases.
Tests directly access shadowRoot; ensure the component always attaches to shadow DOM or provide fallback behavior in environments where shadow DOM may not be available.
In the "renders nothing when HTML content is empty" test, you should query for the emptyHtml block ID instead of "html", since you're rendering <HTMLBlock id="emptyHtml" />. This will correctly assert that the empty block is not rendered.
Why: The test currently queries the wrong selector and should use emptyHtml to accurately verify that the empty block isn’t rendered.
Medium
General
Assert attribute removal directly
Rather than checking the raw HTML string, use a DOM assertion to verify that the onerror attribute has been stripped from the element. This makes the test more robust against serialization differences.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Changes Made
How to Test
Notes