Skip to content

Clarify that (lang="") means explicitly unknown, not default.#43413

Merged
pepelsbey merged 2 commits intomdn:mainfrom
mohammed-ali-osman:fix-lang
Mar 12, 2026
Merged

Clarify that (lang="") means explicitly unknown, not default.#43413
pepelsbey merged 2 commits intomdn:mainfrom
mohammed-ali-osman:fix-lang

Conversation

@mohammed-ali-osman
Copy link
Contributor

Description

The previous note on the lang attribute said the default value is the empty string.

That was incorrect, the empty string only applies when the attribute is explicitly set, which signals the language is explicitly unknown.

Spec reference:

 If the resulting value is the empty string, then it must be interpreted as meaning that the language of the node is explicitly unknown.

This PR updates the note to be spec-accurate and complements the inheritance section.

Preview

Note

If the value of lang is set to empty string the language is explicitly unknown. Therefore, it is recommended to always specify an appropriate value for this attribute.

fixes #43259

@mohammed-ali-osman mohammed-ali-osman requested a review from a team as a code owner March 12, 2026 11:55
@github-actions github-actions bot added Content:HTML Hypertext Markup Language docs size/xs [PR only] 0-5 LoC changed labels Mar 12, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2026

Preview URLs (1 page)

(comment last updated: 2026-03-12 14:04:25)

Copy link
Member

@pepelsbey pepelsbey left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you 🙂

I have a small suggestion.

@mohammed-ali-osman
Copy link
Contributor Author

Thanks for suggestions and the review @pepelsbey!

@pepelsbey pepelsbey merged commit a2a094e into mdn:main Mar 12, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:HTML Hypertext Markup Language docs size/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lang attribute does not default to empty string

2 participants