Skip to content

Fix self-closing img tag in author section#636

Open
seneca wants to merge 1 commit intonuejs:masterfrom
seneca:patch-54
Open

Fix self-closing img tag in author section#636
seneca wants to merge 1 commit intonuejs:masterfrom
seneca:patch-54

Conversation

@seneca
Copy link
Contributor

@seneca seneca commented Oct 18, 2025

Incomplete img closing tag.

Incomplete img closing tag.
@nobkd
Copy link
Collaborator

nobkd commented Oct 18, 2025

HTML5 doesn't care about that slash. There are no real self-closing tags, only void tags, and those just allow the "self-closing" slash.

I personally would prefer to just never use /> for void tags (just <void>), as the usage imitates XML and may cause confusion, as real self-closing behavior does not exist in html5 (different from xml/svg), but that's just my opinion. 🤷

Of course the docs should be consistent in the use of that pattern.

what do you think?

@seneca
Copy link
Contributor Author

seneca commented Oct 18, 2025 via email

@nobkd
Copy link
Collaborator

nobkd commented Oct 20, 2025

From the HTML standard:

  1. Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/), which on foreign elements marks the start tag as self-closing. On void elements, it does not mark the start tag as self-closing but instead is unnecessary and has no effect of any kind. For such void elements, it should be used only with caution — especially since, if directly preceded by an unquoted attribute value, it becomes part of the attribute value rather than being discarded by the parser.

My opinion on just not using /> in HTML stays the same, but in the end it doesn't really matter, as it --- as you said --- is such a minor thing.
And yes, I think @tipiirai should decide on that.

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.

2 participants