mdn / yari

The platform code behind MDN Web Docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trailing slash on void element

Rotzbua opened this issue · comments

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

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.

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.

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.

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.