[Django] #30495: Use self-closing br in linebreaksbr templatetag

6 views
Skip to first unread message

Django

unread,
May 20, 2019, 7:48:07 PM5/20/19
to django-...@googlegroups.com
#30495: Use self-closing br in linebreaksbr templatetag
-------------------------------------------+------------------------
Reporter: David Ogutu | Owner: nobody
Type: New feature | Status: new
Component: Template system | Version: 2.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 1 |
-------------------------------------------+------------------------
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

--
Ticket URL: <https://code.djangoproject.com/ticket/30495>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 20, 2019, 7:48:53 PM5/20/19
to django-...@googlegroups.com
#30495: Use self-closing br in linebreaksbr templatetag
---------------------------------+---------------------------------------
Reporter: David Ogutu | Owner: David Ogutu
Type: New feature | Status: assigned

Component: Template system | Version: 2.2
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
---------------------------------+---------------------------------------
Changes (by David Ogutu):

* status: new => assigned
* owner: nobody => David Ogutu


--
Ticket URL: <https://code.djangoproject.com/ticket/30495#comment:1>

Django

unread,
May 21, 2019, 1:51:00 AM5/21/19
to django-...@googlegroups.com
#30495: Use self-closing br in linebreaksbr templatetag.
-------------------------------------+-------------------------------------

Reporter: David Ogutu | Owner: David
Type: | Ogutu
Cleanup/optimization | Status: closed
Component: Template system | Version: master
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* status: assigned => closed
* resolution: => wontfix
* version: 2.2 => master
* ui_ux: 1 => 0
* type: New feature => Cleanup/optimization


Comment:

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 [https://groups.google.com/d/topic/django-
developers/G4Rz1_Bmh7w/discussion django-developers discussion] (self-
closing tags are a part of it) and ticket #29681. IMO
[https://docs.djangoproject.com/en/stable/ref/forms/renderers/#overriding-
built-in-widget-templates custom widget templates] should solve your
issue.

--
Ticket URL: <https://code.djangoproject.com/ticket/30495#comment:2>

Django

unread,
May 21, 2019, 10:04:41 AM5/21/19
to django-...@googlegroups.com
#30495: Use self-closing br in linebreaksbr templatetag.
-------------------------------------+-------------------------------------
Reporter: David Ogutu | Owner: David
Type: | Ogutu
Cleanup/optimization | Status: closed
Component: Template system | Version: master
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by David Ogutu):

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/30495#comment:3>

Reply all
Reply to author
Forward
0 new messages