Skip to content
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

Bug: Trailing slash on void elements has no effect and interacts badly with unquoted attribute values. #25944

Closed
wscourge opened this issue Dec 27, 2022 · 4 comments
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@wscourge
Copy link

React version: latest

Steps To Reproduce

  1. Render <br /> tag.

Link to code example

The current behavior

It renders <br />.

The expected behavior

It renders <br>.

Context

I'd like React to support removing trailing slash from void HTML elements out of the box. Due to validator.w3.org:

Info: Trailing slash on void elements has no effect and interacts badly with unquoted attribute values.

I originally requested this as a feature in Next.js, and was sent here.

Cheers.

@wscourge wscourge added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Dec 27, 2022
@vkurchatkin
Copy link

Can you provide an example where this is an issue?

@wscourge
Copy link
Author

@vkurchatkin
Copy link

This doesn't seem to be an issue or problem of any kind. It's not even a "warning" message or something like that, it is and "info" message. The markup itself is perfectly fine and has no issues

@eps1lon
Copy link
Collaborator

eps1lon commented Dec 29, 2022

Closing in favor of validator/validator#1509. This is just an "info" message. Either this should not be flagged at all or W3 validator should be more explicit about what "info" means.

We could omit the trailing slash but we have to special case known void element tags which adds bytes and runtime cost so it's unlikely to give any gains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

3 participants