Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#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 David Ogutu, 5 years ago

Owner: changed from nobody to David Ogutu
Status: newassigned

comment:2 by Mariusz Felisiak, 5 years ago

Resolution: wontfix
Status: assignedclosed
Summary: Use self-closing br in linebreaksbr templatetagUse self-closing br in linebreaksbr templatetag.
Type: New featureCleanup/optimization
UI/UX: unset
Version: 2.2master

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.

comment:3 by David Ogutu, 5 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.

Note: See TracTickets for help on using tickets.
Back to Top