Opened 7 years ago
Closed 6 years ago
#29038 closed Cleanup/optimization (fixed)
Render HTML void elements without a closing slash
Reported by: | Jon Dufresne | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In HTML5 syntax, the solidus for void elements is optional and has no effect.
As Django already uses HTML5 specific syntax (e.g. boolean attributes), can take advantage of other HTML5 syntax. Therefore, can render HTML tags without a final solidus.
The HTML5 spec says:
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 (/). This character has no effect on void elements
Change History (6)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
Has patch: | set |
---|
comment:3 by , 7 years ago
Component: | Uncategorized → Forms |
---|---|
Summary: | Render HTML void elements without a solidus → Render HTML void elements without a closing slash |
Triage Stage: | Unreviewed → Accepted |
comment:5 by , 6 years ago
Resolution: | fixed |
---|---|
Status: | closed → new |
This broke my site when I tried to update to Django 2.1. I serve my pages using XHTML serialization of HTML5 which is perfectly valid. That is I server my pages using application/xhtml+xml mimetype. It is unusual, I know, but I prefer the strict syntax checking I get with it. I know XHTML-Strict has gone out of fashion, but HTML5 is not a replacement for XHTML. HTML5 can be served as both application/xhtml+xml and text/html and both are equally valid.
Browser support for xhtml is better than ever, so this is a better time than ever to server pages using xhtml serialization. When XHTML-Strict was viewed as the "way forward" it was effectively stopped by IE not supporting it. This is no longer the case since IE9.
A web framework should have it's html written with polygot markup.
Please revert this changes. I will happily provide a pull-request to make all html in Django into polygot markup.
comment:6 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
We will open a new ticket if the django-developers discussion yields a consensus to revisit this decision.
PR