mdn / yari

The platform code behind MDN Web Docs
Mozilla Public License 2.0
1.17k stars 500 forks source link

Trailing slash on void element #11091

Open Rotzbua opened 4 months ago

Rotzbua commented 4 months ago

Summary

From Nu Html Checker: Trailing slash on void elements has no effect and interacts badly with unquoted attribute values.

URL

https://developer.mozilla.org/en-US/docs/Glossary/Void_element

Reproduction steps

  1. Open html source code in browser and look html up or
  2. Use online tool: https://validator.w3.org/nu/?doc=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FGlossary%2FVoid_element

Expected behavior

Correct html:

<meta charset="utf-8">

Actual behavior

Formal wrong html:

<meta charset="utf-8"/>

Device

Desktop

Browser

Firefox

Browser version

Stable

Operating system

Windows

Screenshot

No response

Anything else?

No response

Validations

estelle commented 4 months ago

This has been discussed https://github.com/orgs/mdn/discussions/242

We are not removing the trailing slashes. Doing so would require forking Prettier. The MDN Web Docs team has decided not to fork Prettier as it would introduce a big maintenance burden that is not sustainable. Concerns can be addressed to the Prettier project.

pepelsbey commented 3 months ago

We are not removing the trailing slashes. Doing so would require forking Prettier.

@estelle not exactly, there’s a Prettier plugin that overrides this setting. So, if we ever reconsider this decision, it would be possible to implement it.

Rotzbua commented 3 months ago

The discussion is about the examples and content. As far as I have checked, prettier is not applied to the HTML template for the website.

pepelsbey commented 3 months ago

The discussion is about the examples and content. As far as I have checked, prettier is not applied to the HTML template for the website.

There’s a .prettierrc config and a test running prettier check in the packgage.json. We apply the same code style across all MDN projects.