Remove trailing slashes on void elements

Created on 6 March 2023, almost 2 years ago
Updated 6 March 2024, 11 months ago

Problem/Motivation

The HTML specification recommends not to output trailing slashes for void elements. For example, when I run the W3C validator on https://dri.es/, I get the following output:

For more information, see https://github.com/validator/validator/wiki/Markup-%C2%BB-Void-elements.

Proposed resolution

Change line 88 in of ./lib/Drupal/Core/Render/Element/HtmlTag.php. The function preRenderHtmlTag() is responsible for adding the trailing slash.

📌 Task
Status

Closed: duplicate

Version

11.0 🔥

Component
Render 

Last updated about 8 hours ago

Created by

🇧🇪Belgium Dries

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

  • Needs frontend framework manager review

    Used to alert the fron-tend framework manager core committer(s) that a front-end focused issue significantly impacts (or has the potential to impact) multiple subsystems or represents a significant change or addition in architecture or public APIs, and their signoff is needed (see the governance policy for more information). If an issue significantly impacts only one subsystem, use Needs subsystem maintainer review instead, and make sure the issue component is set to the correct subsystem.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024