#30495 closed Cleanup/optimization (wontfix)
Use self-closing br in linebreaksbr templatetag.
Reported by: | David Ogutu | Owned by: | David Ogutu |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
The HTML 5 spec says that it's OK to use self-closing tags for void elements
https://dev.w3.org/html5/html-author/#void
I'd like to change linebreaksbr to use the self-closing version of br
i.e. <br/>
so it can be used safely in more environments.
As an example, I wanted to use it in a template generating RML (see https://www.reportlab.com/software/rml-reference/).
This will not break any existing users but will expand the templatetag's reach
Change History (3)
comment:1 by , 6 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 6 years ago
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Summary: | Use self-closing br in linebreaksbr templatetag → Use self-closing br in linebreaksbr templatetag. |
Type: | New feature → Cleanup/optimization |
UI/UX: | unset |
Version: | 2.2 → master |
comment:3 by , 6 years ago
Thanks. I've looked at the discussion and I agree that it makes sense to keep this closed. For future visitors, I think a better way might be to create an intermediary template renderer.
Thanks for this request. I know that this change looks trivial but probably it is not the only one that is required in your use case. Please take a look at the django-developers discussion (self-closing tags are a part of it) and ticket #29681. IMO custom widget templates should solve your issue.