Skip to content

FF140 escaping < and > to &lt; and &gt; in attributes when serializing HTML - #39639

Merged
pepelsbey merged 5 commits into
mdn:mainfrom
hamishwillee:ff140expr_docs_serialize_html_gtlt
May 26, 2025
Merged

pepelsbey merged 5 commits into
mdn:mainfrom
hamishwillee:ff140expr_docs_serialize_html_gtlt

Conversation

@hamishwillee

Copy link
Copy Markdown
Collaborator

FF140 ships support for escaping < and > to &lt; and &gt; in attributes when serializing HTML in https://bugzilla.mozilla.org/show_bug.cgi?id=1962084. This affects all the obvious methods like innerHTML, outerHTML, getHTML etc.

This PR removes the info in the experimental features page (the addition to Relnote is in a separate PR).

I also added a note to the end of each of the affected methods pointing down to the browser compatibility for this feature. Note that the feature is non standard, but is expected to be standardized soon.

Related docs work can be tracked in #39628

@hamishwillee
hamishwillee requested review from a team, pepelsbey and wbamberg and removed request for a team May 23, 2025 04:57
@github-actions github-actions Bot added Content:WebAPI Web API docs Content:Firefox Content in the Mozilla/Firefox subtree labels May 23, 2025
instead.
To only obtain the HTML representation of the contents of an element, or to replace the contents of an element, use the {{domxref("Element.innerHTML", "innerHTML")}} property instead.

Note that some browsers serialize `<` and `>` in attributes as `&lt;` and `&gt;` when reading the HTML (see [Browser compatibility](#browser_compatibility)).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only actual change in this page.

@github-actions github-actions Bot added the size/m [PR only] 51-500 LoC changed label May 23, 2025
@github-actions

github-actions Bot commented May 23, 2025 •

Copy link
Copy Markdown
Contributor
Preview URLs (6 pages)
Flaws (1)

Note! 5 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Mozilla/Firefox/Experimental_features
Title: Experimental features in Firefox
Flaw count: 1

  • broken_links:
    • Can't resolve /en-US/docs/Web/API/HTML_Sanitizer_API
External URLs (77)

URL: /en-US/docs/Mozilla/Firefox/Experimental_features
Title: Experimental features in Firefox


URL: /en-US/docs/Web/API/Element/getHTML
Title: Element: getHTML() method

(comment last updated: 2025-05-26 18:50:53)

The **`innerHTML`** property of the {{domxref("ShadowRoot")}}
interface sets or returns a reference to the DOM tree inside the
`ShadowRoot`.
The **`innerHTML`** property of the {{domxref("ShadowRoot")}} interface sets gets or sets the HTML markup to the DOM tree inside the `ShadowRoot`.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text here seemed completely wrong - it isn't a reference. There is a lot more that can be said.

I don't want to say it in this PR because that would be out of scope for this task. I do expect to be back here though, as I am currently doing work on the HTLM sanitization API which tanjentially affects this. I will also be looking at it as I add docs on the injection sinks for TrustedTypes.

Co-authored-by: Hamish Willee <[email protected]>

@pepelsbey pepelsbey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you :)

pepelsbey and others added 2 commits May 26, 2025 20:48
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@pepelsbey
pepelsbey merged commit 9ec0f8b into mdn:main May 26, 2025
zachernuk pushed a commit to zachernuk/content that referenced this pull request Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:Firefox Content in the Mozilla/Firefox subtree Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants