-
Notifications
You must be signed in to change notification settings - Fork 22.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Clarify behavior of HTML tags within the <title> element (Issue #36702) #36827
Conversation
@@ -8,7 +8,7 @@ browser-compat: api.HTMLTitleElement.text | |||
|
|||
{{APIRef("HTML DOM")}} | |||
|
|||
The **`text`** property of the {{domxref("HTMLTitleElement")}} interface represents the text of the document's title. Only the text part is included; tags within the element and their content are stripped and ignored. | |||
The **`text`** property of the {{domxref("HTMLTitleElement")}} interface represents the text of the document's title.It only contains text; If HTML tags are included within the <title> element, they are also treated as a plain text, rather than being interpreted as HTML. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[markdownlint] reported by reviewdog 🐶
MD033/no-inline-html Inline HTML [Element: title]
``` | ||
|
||
As you can see, the tag `span` and its content were skipped. | ||
As you can see, The 'span' tag and its content were treated as plain text and displayed exactly as they appear in the <title> element, rather than being processed as HTML. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[markdownlint] reported by reviewdog 🐶
MD033/no-inline-html Inline HTML [Element: title]
…najaiswal/MDN-Web-Docs-Code into title-tagcontent-correction Updating branch
Preview URLs (comment last updated: 2024-12-02 14:04:54) |
``` | ||
|
||
As you can see, the tag `span` and its content were skipped. | ||
As you can see, The `span` tag and its content were treated as plain text and displayed exactly as they appear in the `title` element, rather than being processed as HTML. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you can see, The `span` tag and its content were treated as plain text and displayed exactly as they appear in the `title` element, rather than being processed as HTML. | |
As you can see, the `span` tag and its content were treated as plain text and displayed exactly as they appear in the `title` element, rather than being processed as HTML. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you. I made some suggestions, including adding a sample setter in addition to your fixed getter.
Co-authored-by: Estelle Weyl <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Estelle Weyl <[email protected]>
Co-authored-by: Estelle Weyl <[email protected]>
Co-authored-by: Estelle Weyl <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Hi @estelle , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Also, congratulations on your first merged MDN content PR. Welcome to the team!
Description
This pull request addresses Issue #36702 by updating the documentation for the <title> element to clarify that HTML tags within the <title> are treated as plain text and not parsed as HTML.Motivation
This change ensures developers understand the behavior when using HTML tags in the <title>.Additional details
Issue #36702Related issues and pull requests
Fixes #36702