summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2018-01-20 23:09:10 -0800
committerTim Graham <timograham@gmail.com>2018-01-21 02:09:10 -0500
commitff05de760cc4ef4c7f188e163c722ec3bc1f0cbf (patch)
treeba133d0ecea7521935c98cf1c058df4e6a9ff233 /docs/ref
parent4b0f39d9fb2033a9597e30ac13af162440b82ebc (diff)
Fixed #29038 -- Removed closing slash from HTML void tags.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/class-based-views/generic-editing.txt8
-rw-r--r--docs/ref/contrib/admin/index.txt2
-rw-r--r--docs/ref/forms/api.txt222
-rw-r--r--docs/ref/forms/fields.txt50
-rw-r--r--docs/ref/forms/widgets.txt34
-rw-r--r--docs/ref/request-response.txt2
-rw-r--r--docs/ref/templates/builtins.txt22
-rw-r--r--docs/ref/templates/language.txt4
8 files changed, 172 insertions, 172 deletions
diff --git a/docs/ref/class-based-views/generic-editing.txt b/docs/ref/class-based-views/generic-editing.txt
index 65cd772536..8c1fe0f758 100644
--- a/docs/ref/class-based-views/generic-editing.txt
+++ b/docs/ref/class-based-views/generic-editing.txt
@@ -76,7 +76,7 @@ editing content:
<form action="" method="post">{% csrf_token %}
{{ form.as_p }}
- <input type="submit" value="Send message" />
+ <input type="submit" value="Send message">
</form>
@@ -132,7 +132,7 @@ editing content:
<form action="" method="post">{% csrf_token %}
{{ form.as_p }}
- <input type="submit" value="Save" />
+ <input type="submit" value="Save">
</form>
``UpdateView``
@@ -189,7 +189,7 @@ editing content:
<form action="" method="post">{% csrf_token %}
{{ form.as_p }}
- <input type="submit" value="Update" />
+ <input type="submit" value="Update">
</form>
``DeleteView``
@@ -240,5 +240,5 @@ editing content:
<form action="" method="post">{% csrf_token %}
<p>Are you sure you want to delete "{{ object }}"?</p>
- <input type="submit" value="Confirm" />
+ <input type="submit" value="Confirm">
</form>
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index c043561f17..39c02f26af 100644
--- a/docs/ref/contrib/admin/index.txt
+++ b/docs/ref/contrib/admin/index.txt
@@ -1180,7 +1180,7 @@ subclass::
# for each line of the address and you want to separate each
# line by a linebreak
return format_html_join(
- mark_safe('<br/>'),
+ mark_safe('<br>'),
'{}',
((line,) for line in instance.get_full_address()),
) or mark_safe("<span class='errors'>I can't determine this address.</span>")
diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt
index 5e001a2f62..bafa688f98 100644
--- a/docs/ref/forms/api.txt
+++ b/docs/ref/forms/api.txt
@@ -255,9 +255,9 @@ precedence::
... comment = forms.CharField()
>>> f = CommentForm(initial={'name': 'instance'}, auto_id=False)
>>> print(f)
- <tr><th>Name:</th><td><input type="text" name="name" value="instance" required /></td></tr>
- <tr><th>Url:</th><td><input type="url" name="url" required /></td></tr>
- <tr><th>Comment:</th><td><input type="text" name="comment" required /></td></tr>
+ <tr><th>Name:</th><td><input type="text" name="name" value="instance" required></td></tr>
+ <tr><th>Url:</th><td><input type="url" name="url" required></td></tr>
+ <tr><th>Comment:</th><td><input type="text" name="comment" required></td></tr>
.. method:: Form.get_initial_for_field(field, field_name)
@@ -322,10 +322,10 @@ You can alter the field of :class:`Form` instance to change the way it is
presented in the form::
>>> f.as_table().split('\n')[0]
- '<tr><th>Name:</th><td><input name="name" type="text" value="instance" required /></td></tr>'
+ '<tr><th>Name:</th><td><input name="name" type="text" value="instance" required></td></tr>'
>>> f.fields['name'].label = "Username"
>>> f.as_table().split('\n')[0]
- '<tr><th>Username:</th><td><input name="name" type="text" value="instance" required /></td></tr>'
+ '<tr><th>Username:</th><td><input name="name" type="text" value="instance" required></td></tr>'
Beware not to alter the ``base_fields`` attribute because this modification
will influence all subsequent ``ContactForm`` instances within the same Python
@@ -334,7 +334,7 @@ process::
>>> f.base_fields['name'].label = "Username"
>>> another_f = CommentForm(auto_id=False)
>>> another_f.as_table().split('\n')[0]
- '<tr><th>Username:</th><td><input name="name" type="text" value="class" required /></td></tr>'
+ '<tr><th>Username:</th><td><input name="name" type="text" value="class" required></td></tr>'
Accessing "clean" data
======================
@@ -438,10 +438,10 @@ simply ``print`` it::
>>> f = ContactForm()
>>> print(f)
- <tr><th><label for="id_subject">Subject:</label></th><td><input id="id_subject" type="text" name="subject" maxlength="100" required /></td></tr>
- <tr><th><label for="id_message">Message:</label></th><td><input type="text" name="message" id="id_message" required /></td></tr>
- <tr><th><label for="id_sender">Sender:</label></th><td><input type="email" name="sender" id="id_sender" required /></td></tr>
- <tr><th><label for="id_cc_myself">Cc myself:</label></th><td><input type="checkbox" name="cc_myself" id="id_cc_myself" /></td></tr>
+ <tr><th><label for="id_subject">Subject:</label></th><td><input id="id_subject" type="text" name="subject" maxlength="100" required></td></tr>
+ <tr><th><label for="id_message">Message:</label></th><td><input type="text" name="message" id="id_message" required></td></tr>
+ <tr><th><label for="id_sender">Sender:</label></th><td><input type="email" name="sender" id="id_sender" required></td></tr>
+ <tr><th><label for="id_cc_myself">Cc myself:</label></th><td><input type="checkbox" name="cc_myself" id="id_cc_myself"></td></tr>
If the form is bound to data, the HTML output will include that data
appropriately. For example, if a field is represented by an
@@ -455,10 +455,10 @@ include ``checked`` if appropriate::
... 'cc_myself': True}
>>> f = ContactForm(data)
>>> print(f)
- <tr><th><label for="id_subject">Subject:</label></th><td><input id="id_subject" type="text" name="subject" maxlength="100" value="hello" required /></td></tr>
- <tr><th><label for="id_message">Message:</label></th><td><input type="text" name="message" id="id_message" value="Hi there" required /></td></tr>
- <tr><th><label for="id_sender">Sender:</label></th><td><input type="email" name="sender" id="id_sender" value="foo@example.com" required /></td></tr>
- <tr><th><label for="id_cc_myself">Cc myself:</label></th><td><input type="checkbox" name="cc_myself" id="id_cc_myself" checked /></td></tr>
+ <tr><th><label for="id_subject">Subject:</label></th><td><input id="id_subject" type="text" name="subject" maxlength="100" value="hello" required></td></tr>
+ <tr><th><label for="id_message">Message:</label></th><td><input type="text" name="message" id="id_message" value="Hi there" required></td></tr>
+ <tr><th><label for="id_sender">Sender:</label></th><td><input type="email" name="sender" id="id_sender" value="foo@example.com" required></td></tr>
+ <tr><th><label for="id_cc_myself">Cc myself:</label></th><td><input type="checkbox" name="cc_myself" id="id_cc_myself" checked></td></tr>
This default output is a two-column HTML table, with a ``<tr>`` for each field.
Notice the following:
@@ -506,12 +506,12 @@ containing one field::
>>> f = ContactForm()
>>> f.as_p()
- '<p><label for="id_subject">Subject:</label> <input id="id_subject" type="text" name="subject" maxlength="100" required /></p>\n<p><label for="id_message">Message:</label> <input type="text" name="message" id="id_message" required /></p>\n<p><label for="id_sender">Sender:</label> <input type="text" name="sender" id="id_sender" required /></p>\n<p><label for="id_cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="id_cc_myself" /></p>'
+ '<p><label for="id_subject">Subject:</label> <input id="id_subject" type="text" name="subject" maxlength="100" required></p>\n<p><label for="id_message">Message:</label> <input type="text" name="message" id="id_message" required></p>\n<p><label for="id_sender">Sender:</label> <input type="text" name="sender" id="id_sender" required></p>\n<p><label for="id_cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="id_cc_myself"></p>'
>>> print(f.as_p())
- <p><label for="id_subject">Subject:</label> <input id="id_subject" type="text" name="subject" maxlength="100" required /></p>
- <p><label for="id_message">Message:</label> <input type="text" name="message" id="id_message" required /></p>
- <p><label for="id_sender">Sender:</label> <input type="email" name="sender" id="id_sender" required /></p>
- <p><label for="id_cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="id_cc_myself" /></p>
+ <p><label for="id_subject">Subject:</label> <input id="id_subject" type="text" name="subject" maxlength="100" required></p>
+ <p><label for="id_message">Message:</label> <input type="text" name="message" id="id_message" required></p>
+ <p><label for="id_sender">Sender:</label> <input type="email" name="sender" id="id_sender" required></p>
+ <p><label for="id_cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="id_cc_myself"></p>
``as_ul()``
-----------
@@ -525,12 +525,12 @@ flexibility::
>>> f = ContactForm()
>>> f.as_ul()
- '<li><label for="id_subject">Subject:</label> <input id="id_subject" type="text" name="subject" maxlength="100" required /></li>\n<li><label for="id_message">Message:</label> <input type="text" name="message" id="id_message" required /></li>\n<li><label for="id_sender">Sender:</label> <input type="email" name="sender" id="id_sender" required /></li>\n<li><label for="id_cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="id_cc_myself" /></li>'
+ '<li><label for="id_subject">Subject:</label> <input id="id_subject" type="text" name="subject" maxlength="100" required></li>\n<li><label for="id_message">Message:</label> <input type="text" name="message" id="id_message" required></li>\n<li><label for="id_sender">Sender:</label> <input type="email" name="sender" id="id_sender" required></li>\n<li><label for="id_cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="id_cc_myself"></li>'
>>> print(f.as_ul())
- <li><label for="id_subject">Subject:</label> <input id="id_subject" type="text" name="subject" maxlength="100" required /></li>
- <li><label for="id_message">Message:</label> <input type="text" name="message" id="id_message" required /></li>
- <li><label for="id_sender">Sender:</label> <input type="email" name="sender" id="id_sender" required /></li>
- <li><label for="id_cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="id_cc_myself" /></li>
+ <li><label for="id_subject">Subject:</label> <input id="id_subject" type="text" name="subject" maxlength="100" required></li>
+ <li><label for="id_message">Message:</label> <input type="text" name="message" id="id_message" required></li>
+ <li><label for="id_sender">Sender:</label> <input type="email" name="sender" id="id_sender" required></li>
+ <li><label for="id_cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="id_cc_myself"></li>
``as_table()``
--------------
@@ -543,12 +543,12 @@ it calls its ``as_table()`` method behind the scenes::
>>> f = ContactForm()
>>> f.as_table()
- '<tr><th><label for="id_subject">Subject:</label></th><td><input id="id_subject" type="text" name="subject" maxlength="100" required /></td></tr>\n<tr><th><label for="id_message">Message:</label></th><td><input type="text" name="message" id="id_message" required /></td></tr>\n<tr><th><label for="id_sender">Sender:</label></th><td><input type="email" name="sender" id="id_sender" required /></td></tr>\n<tr><th><label for="id_cc_myself">Cc myself:</label></th><td><input type="checkbox" name="cc_myself" id="id_cc_myself" /></td></tr>'
+ '<tr><th><label for="id_subject">Subject:</label></th><td><input id="id_subject" type="text" name="subject" maxlength="100" required></td></tr>\n<tr><th><label for="id_message">Message:</label></th><td><input type="text" name="message" id="id_message" required></td></tr>\n<tr><th><label for="id_sender">Sender:</label></th><td><input type="email" name="sender" id="id_sender" required></td></tr>\n<tr><th><label for="id_cc_myself">Cc myself:</label></th><td><input type="checkbox" name="cc_myself" id="id_cc_myself"></td></tr>'
>>> print(f)
- <tr><th><label for="id_subject">Subject:</label></th><td><input id="id_subject" type="text" name="subject" maxlength="100" required /></td></tr>
- <tr><th><label for="id_message">Message:</label></th><td><input type="text" name="message" id="id_message" required /></td></tr>
- <tr><th><label for="id_sender">Sender:</label></th><td><input type="email" name="sender" id="id_sender" required /></td></tr>
- <tr><th><label for="id_cc_myself">Cc myself:</label></th><td><input type="checkbox" name="cc_myself" id="id_cc_myself" /></td></tr>
+ <tr><th><label for="id_subject">Subject:</label></th><td><input id="id_subject" type="text" name="subject" maxlength="100" required></td></tr>
+ <tr><th><label for="id_message">Message:</label></th><td><input type="text" name="message" id="id_message" required></td></tr>
+ <tr><th><label for="id_sender">Sender:</label></th><td><input type="email" name="sender" id="id_sender" required></td></tr>
+ <tr><th><label for="id_cc_myself">Cc myself:</label></th><td><input type="checkbox" name="cc_myself" id="id_cc_myself"></td></tr>
.. _ref-forms-api-styling-form-rows:
@@ -618,20 +618,20 @@ tags nor ``id`` attributes::
>>> f = ContactForm(auto_id=False)
>>> print(f.as_table())
- <tr><th>Subject:</th><td><input type="text" name="subject" maxlength="100" required /></td></tr>
- <tr><th>Message:</th><td><input type="text" name="message" required /></td></tr>
- <tr><th>Sender:</th><td><input type="email" name="sender" required /></td></tr>
- <tr><th>Cc myself:</th><td><input type="checkbox" name="cc_myself" /></td></tr>
+ <tr><th>Subject:</th><td><input type="text" name="subject" maxlength="100" required></td></tr>
+ <tr><th>Message:</th><td><input type="text" name="message" required></td></tr>
+ <tr><th>Sender:</th><td><input type="email" name="sender" required></td></tr>
+ <tr><th>Cc myself:</th><td><input type="checkbox" name="cc_myself"></td></tr>
>>> print(f.as_ul())
- <li>Subject: <input type="text" name="subject" maxlength="100" required /></li>
- <li>Message: <input type="text" name="message" required /></li>
- <li>Sender: <input type="email" name="sender" required /></li>
- <li>Cc myself: <input type="checkbox" name="cc_myself" /></li>
+ <li>Subject: <input type="text" name="subject" maxlength="100" required></li>
+ <li>Message: <input type="text" name="message" required></li>
+ <li>Sender: <input type="email" name="sender" required></li>
+ <li>Cc myself: <input type="checkbox" name="cc_myself"></li>
>>> print(f.as_p())
- <p>Subject: <input type="text" name="subject" maxlength="100" required /></p>
- <p>Message: <input type="text" name="message" required /></p>
- <p>Sender: <input type="email" name="sender" required /></p>
- <p>Cc myself: <input type="checkbox" name="cc_myself" /></p>
+ <p>Subject: <input type="text" name="subject" maxlength="100" required></p>
+ <p>Message: <input type="text" name="message" required></p>
+ <p>Sender: <input type="email" name="sender" required></p>
+ <p>Cc myself: <input type="checkbox" name="cc_myself"></p>
If ``auto_id`` is set to ``True``, then the form output *will* include
``<label>`` tags and will simply use the field name as its ``id`` for each form
@@ -639,20 +639,20 @@ field::
>>> f = ContactForm(auto_id=True)
>>> print(f.as_table())
- <tr><th><label for="subject">Subject:</label></th><td><input id="subject" type="text" name="subject" maxlength="100" required /></td></tr>
- <tr><th><label for="message">Message:</label></th><td><input type="text" name="message" id="message" required /></td></tr>
- <tr><th><label for="sender">Sender:</label></th><td><input type="email" name="sender" id="sender" required /></td></tr>
- <tr><th><label for="cc_myself">Cc myself:</label></th><td><input type="checkbox" name="cc_myself" id="cc_myself" /></td></tr>
+ <tr><th><label for="subject">Subject:</label></th><td><input id="subject" type="text" name="subject" maxlength="100" required></td></tr>
+ <tr><th><label for="message">Message:</label></th><td><input type="text" name="message" id="message" required></td></tr>
+ <tr><th><label for="sender">Sender:</label></th><td><input type="email" name="sender" id="sender" required></td></tr>
+ <tr><th><label for="cc_myself">Cc myself:</label></th><td><input type="checkbox" name="cc_myself" id="cc_myself"></td></tr>
>>> print(f.as_ul())
- <li><label for="subject">Subject:</label> <input id="subject" type="text" name="subject" maxlength="100" required /></li>
- <li><label for="message">Message:</label> <input type="text" name="message" id="message" required /></li>
- <li><label for="sender">Sender:</label> <input type="email" name="sender" id="sender" required /></li>
- <li><label for="cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="cc_myself" /></li>
+ <li><label for="subject">Subject:</label> <input id="subject" type="text" name="subject" maxlength="100" required></li>
+ <li><label for="message">Message:</label> <input type="text" name="message" id="message" required></li>
+ <li><label for="sender">Sender:</label> <input type="email" name="sender" id="sender" required></li>
+ <li><label for="cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="cc_myself"></li>
>>> print(f.as_p())
- <p><label for="subject">Subject:</label> <input id="subject" type="text" name="subject" maxlength="100" required /></p>
- <p><label for="message">Message:</label> <input type="text" name="message" id="message" required /></p>
- <p><label for="sender">Sender:</label> <input type="email" name="sender" id="sender" required /></p>
- <p><label for="cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="cc_myself" /></p>
+ <p><label for="subject">Subject:</label> <input id="subject" type="text" name="subject" maxlength="100" required></p>
+ <p><label for="message">Message:</label> <input type="text" name="message" id="message" required></p>
+ <p><label for="sender">Sender:</label> <input type="email" name="sender" id="sender" required></p>
+ <p><label for="cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="cc_myself"></p>
If ``auto_id`` is set to a string containing the format character ``'%s'``,
then the form output will include ``<label>`` tags, and will generate ``id``
@@ -662,20 +662,20 @@ attributes based on the format string. For example, for a format string
>>> f = ContactForm(auto_id='id_for_%s')
>>> print(f.as_table())
- <tr><th><label for="id_for_subject">Subject:</label></th><td><input id="id_for_subject" type="text" name="subject" maxlength="100" required /></td></tr>
- <tr><th><label for="id_for_message">Message:</label></th><td><input type="text" name="message" id="id_for_message" required /></td></tr>
- <tr><th><label for="id_for_sender">Sender:</label></th><td><input type="email" name="sender" id="id_for_sender" required /></td></tr>
- <tr><th><label for="id_for_cc_myself">Cc myself:</label></th><td><input type="checkbox" name="cc_myself" id="id_for_cc_myself" /></td></tr>
+ <tr><th><label for="id_for_subject">Subject:</label></th><td><input id="id_for_subject" type="text" name="subject" maxlength="100" required></td></tr>
+ <tr><th><label for="id_for_message">Message:</label></th><td><input type="text" name="message" id="id_for_message" required></td></tr>
+ <tr><th><label for="id_for_sender">Sender:</label></th><td><input type="email" name="sender" id="id_for_sender" required></td></tr>
+ <tr><th><label for="id_for_cc_myself">Cc myself:</label></th><td><input type="checkbox" name="cc_myself" id="id_for_cc_myself"></td></tr>
>>> print(f.as_ul())
- <li><label for="id_for_subject">Subject:</label> <input id="id_for_subject" type="text" name="subject" maxlength="100" required /></li>
- <li><label for="id_for_message">Message:</label> <input type="text" name="message" id="id_for_message" required /></li>
- <li><label for="id_for_sender">Sender:</label> <input type="email" name="sender" id="id_for_sender" required /></li>
- <li><label for="id_for_cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="id_for_cc_myself" /></li>
+ <li><label for="id_for_subject">Subject:</label> <input id="id_for_subject" type="text" name="subject" maxlength="100" required></li>
+ <li><label for="id_for_message">Message:</label> <input type="text" name="message" id="id_for_message" required></li>
+ <li><label for="id_for_sender">Sender:</label> <input type="email" name="sender" id="id_for_sender" required></li>
+ <li><label for="id_for_cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="id_for_cc_myself"></li>
>>> print(f.as_p())
- <p><label for="id_for_subject">Subject:</label> <input id="id_for_subject" type="text" name="subject" maxlength="100" required /></p>
- <p><label for="id_for_message">Message:</label> <input type="text" name="message" id="id_for_message" required /></p>
- <p><label for="id_for_sender">Sender:</label> <input type="email" name="sender" id="id_for_sender" required /></p>
- <p><label for="id_for_cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="id_for_cc_myself" /></p>
+ <p><label for="id_for_subject">Subject:</label> <input id="id_for_subject" type="text" name="subject" maxlength="100" required></p>
+ <p><label for="id_for_message">Message:</label> <input type="text" name="message" id="id_for_message" required></p>
+ <p><label for="id_for_sender">Sender:</label> <input type="email" name="sender" id="id_for_sender" required></p>
+ <p><label for="id_for_cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="id_for_cc_myself"></p>
If ``auto_id`` is set to any other true value -- such as a string that doesn't
include ``%s`` -- then the library will act as if ``auto_id`` is ``True``.
@@ -692,16 +692,16 @@ It's possible to customize that character, or omit it entirely, using the
>>> f = ContactForm(auto_id='id_for_%s', label_suffix='')
>>> print(f.as_ul())
- <li><label for="id_for_subject">Subject</label> <input id="id_for_subject" type="text" name="subject" maxlength="100" required /></li>
- <li><label for="id_for_message">Message</label> <input type="text" name="message" id="id_for_message" required /></li>
- <li><label for="id_for_sender">Sender</label> <input type="email" name="sender" id="id_for_sender" required /></li>
- <li><label for="id_for_cc_myself">Cc myself</label> <input type="checkbox" name="cc_myself" id="id_for_cc_myself" /></li>
+ <li><label for="id_for_subject">Subject</label> <input id="id_for_subject" type="text" name="subject" maxlength="100" required></li>
+ <li><label for="id_for_message">Message</label> <input type="text" name="message" id="id_for_message" required></li>
+ <li><label for="id_for_sender">Sender</label> <input type="email" name="sender" id="id_for_sender" required></li>
+ <li><label for="id_for_cc_myself">Cc myself</label> <input type="checkbox" name="cc_myself" id="id_for_cc_myself"></li>
>>> f = ContactForm(auto_id='id_for_%s', label_suffix=' ->')
>>> print(f.as_ul())
- <li><label for="id_for_subject">Subject -></label> <input id="id_for_subject" type="text" name="subject" maxlength="100" required /></li>
- <li><label for="id_for_message">Message -></label> <input type="text" name="message" id="id_for_message" required /></li>
- <li><label for="id_for_sender">Sender -></label> <input type="email" name="sender" id="id_for_sender" required /></li>
- <li><label for="id_for_cc_myself">Cc myself -></label> <input type="checkbox" name="cc_myself" id="id_for_cc_myself" /></li>
+ <li><label for="id_for_subject">Subject -></label> <input id="id_for_subject" type="text" name="subject" maxlength="100" required></li>
+ <li><label for="id_for_message">Message -></label> <input type="text" name="message" id="id_for_message" required></li>
+ <li><label for="id_for_sender">Sender -></label> <input type="email" name="sender" id="id_for_sender" required></li>
+ <li><label for="id_for_cc_myself">Cc myself -></label> <input type="checkbox" name="cc_myself" id="id_for_cc_myself"></li>
Note that the label suffix is added only if the last character of the
label isn't a punctuation character (in English, those are ``.``, ``!``, ``?``
@@ -788,22 +788,22 @@ method you're using::
... 'cc_myself': True}
>>> f = ContactForm(data, auto_id=False)
>>> print(f.as_table())
- <tr><th>Subject:</th><td><ul class="errorlist"><li>This field is required.</li></ul><input type="text" name="subject" maxlength="100" required /></td></tr>
- <tr><th>Message:</th><td><input type="text" name="message" value="Hi there" required /></td></tr>
- <tr><th>Sender:</th><td><ul class="errorlist"><li>Enter a valid email address.</li></ul><input type="email" name="sender" value="invalid email address" required /></td></tr>
- <tr><th>Cc myself:</th><td><input checked type="checkbox" name="cc_myself" /></td></tr>
+ <tr><th>Subject:</th><td><ul class="errorlist"><li>This field is required.</li></ul><input type="text" name="subject" maxlength="100" required></td></tr>
+ <tr><th>Message:</th><td><input type="text" name="message" value="Hi there" required></td></tr>
+ <tr><th>Sender:</th><td><ul class="errorlist"><li>Enter a valid email address.</li></ul><input type="email" name="sender" value="invalid email address" required></td></tr>
+ <tr><th>Cc myself:</th><td><input checked type="checkbox" name="cc_myself"></td></tr>
>>> print(f.as_ul())
- <li><ul class="errorlist"><li>This field is required.</li></ul>Subject: <input type="text" name="subject" maxlength="100" required /></li>
- <li>Message: <input type="text" name="message" value="Hi there" required /></li>
- <li><ul class="errorlist"><li>Enter a valid email address.</li></ul>Sender: <input type="email" name="sender" value="invalid email address" required /></li>
- <li>Cc myself: <input checked type="checkbox" name="cc_myself" /></li>
+ <li><ul class="errorlist"><li>This field is required.</li></ul>Subject: <input type="text" name="subject" maxlength="100" required></li>
+ <li>Message: <input type="text" name="message" value="Hi there" required></li>
+ <li><ul class="errorlist"><li>Enter a valid email address.</li></ul>Sender: <input type="email" name="sender" value="invalid email address" required></li>
+ <li>Cc myself: <input checked type="checkbox" name="cc_myself"></li>
>>> print(f.as_p())
<p><ul class="errorlist"><li>This field is required.</li></ul></p>
- <p>Subject: <input type="text" name="subject" maxlength="100" required /></p>
- <p>Message: <input type="text" name="message" value="Hi there" required /></p>
+ <p>Subject: <input type="text" name="subject" maxlength="100" required></p>
+ <p>Message: <input type="text" name="message" value="Hi there" required></p>
<p><ul class="errorlist"><li>Enter a valid email address.</li></ul></p>
- <p>Sender: <input type="email" name="sender" value="invalid email address" required /></p>
- <p>Cc myself: <input checked type="checkbox" name="cc_myself" /></p>
+ <p>Sender: <input type="email" name="sender" value="invalid email address" required></p>
+ <p>Cc myself: <input checked type="checkbox" name="cc_myself"></p>
.. _ref-forms-error-list-format:
@@ -824,11 +824,11 @@ pass that in at construction time::
>>> f = ContactForm(data, auto_id=False, error_class=DivErrorList)
>>> f.as_p()
<div class="errorlist"><div class="error">This field is required.</div></div>
- <p>Subject: <input type="text" name="subject" maxlength="100" required /></p>
- <p>Message: <input type="text" name="message" value="Hi there" required /></p>
+ <p>Subject: <input type="text" name="subject" maxlength="100" required></p>
+ <p>Message: <input type="text" name="message" value="Hi there" required></p>
<div class="errorlist"><div class="error">Enter a valid email address.</div></div>
- <p>Sender: <input type="email" name="sender" value="invalid email address" required /></p>
- <p>Cc myself: <input checked type="checkbox" name="cc_myself" /></p>
+ <p>Sender: <input type="email" name="sender" value="invalid email address" required></p>
+ <p>Cc myself: <input checked type="checkbox" name="cc_myself"></p>
More granular output
====================
@@ -848,25 +848,25 @@ using the field's name as the key::
>>> form = ContactForm()
>>> print(form['subject'])
- <input id="id_subject" type="text" name="subject" maxlength="100" required />
+ <input id="id_subject" type="text" name="subject" maxlength="100" required>
To retrieve all ``BoundField`` objects, iterate the form::
>>> form = ContactForm()
>>> for boundfield in form: print(boundfield)
- <input id="id_subject" type="text" name="subject" maxlength="100" required />
- <input type="text" name="message" id="id_message" required />
- <input type="email" name="sender" id="id_sender" required />
- <input type="checkbox" name="cc_myself" id="id_cc_myself" />
+ <input id="id_subject" type="text" name="subject" maxlength="100" required>
+ <input type="text" name="message" id="id_message" required>
+ <input type="email" name="sender" id="id_sender" required>
+ <input type="checkbox" name="cc_myself" id="id_cc_myself">
The field-specific output honors the form object's ``auto_id`` setting::
>>> f = ContactForm(auto_id=False)
>>> print(f['message'])
- <input type="text" name="message" required />
+ <input type="text" name="message" required>
>>> f = ContactForm(auto_id='id_%s')
>>> print(f['message'])
- <input type="text" name="message" id="id_message" required />
+ <input type="text" name="message" id="id_message" required>
Attributes of ``BoundField``
----------------------------
@@ -897,7 +897,7 @@ Attributes of ``BoundField``
>>> data = {'subject': 'hi', 'message': '', 'sender': '', 'cc_myself': ''}
>>> f = ContactForm(data, auto_id=False)
>>> print(f['message'])
- <input type="text" name="message" required />
+ <input type="text" name="message" required>
>>> f['message'].errors
['This field is required.']
>>> print(f['message'].errors)
@@ -949,7 +949,7 @@ Attributes of ``BoundField``
.. code-block:: html
- <label for="myFIELD">...</label><input id="myFIELD" type="text" name="my_field" required />
+ <label for="myFIELD">...</label><input id="myFIELD" type="text" name="my_field" required>
.. attribute:: BoundField.is_hidden
@@ -1168,11 +1168,11 @@ fields are ordered first::
... priority = forms.CharField()
>>> f = ContactFormWithPriority(auto_id=False)
>>> print(f.as_ul())
- <li>Subject: <input type="text" name="subject" maxlength="100" required /></li>
- <li>Message: <input type="text" name="message" required /></li>
- <li>Sender: <input type="email" name="sender" required /></li>
- <li>Cc myself: <input type="checkbox" name="cc_myself" /></li>
- <li>Priority: <input type="text" name="priority" required /></li>
+ <li>Subject: <input type="text" name="subject" maxlength="100" required></li>
+ <li>Message: <input type="text" name="message" required></li>
+ <li>Sender: <input type="email" name="sender" required></li>
+ <li>Cc myself: <input type="checkbox" name="cc_myself"></li>
+ <li>Priority: <input type="text" name="priority" required></li>
It's possible to subclass multiple forms, treating forms as mixins. In this
example, ``BeatleForm`` subclasses both ``PersonForm`` and ``InstrumentForm``
@@ -1189,10 +1189,10 @@ classes::
... haircut_type = forms.CharField()
>>> b = BeatleForm(auto_id=False)
>>> print(b.as_ul())
- <li>First name: <input type="text" name="first_name" required /></li>
- <li>Last name: <input type="text" name="last_name" required /></li>
- <li>Instrument: <input type="text" name="instrument" required /></li>
- <li>Haircut type: <input type="text" name="haircut_type" required /></li>
+ <li>First name: <input type="text" name="first_name" required></li>
+ <li>Last name: <input type="text" name="last_name" required></li>
+ <li>Instrument: <input type="text" name="instrument" required></li>
+ <li>Haircut type: <input type="text" name="haircut_type" required></li>
It's possible to declaratively remove a ``Field`` inherited from a parent class
by setting the name of the field to ``None`` on the subclass. For example::
@@ -1222,11 +1222,11 @@ You can put several Django forms inside one ``<form>`` tag. To give each
>>> mother = PersonForm(prefix="mother")
>>> father = PersonForm(prefix="father")
>>> print(mother.as_ul())
- <li><label for="id_mother-first_name">First name:</label> <input type="text" name="mother-first_name" id="id_mother-first_name" required /></li>
- <li><label for="id_mother-last_name">Last name:</label> <input type="text" name="mother-last_name" id="id_mother-last_name" required /></li>
+ <li><label for="id_mother-first_name">First name:</label> <input type="text" name="mother-first_name" id="id_mother-first_name" required></li>
+ <li><label for="id_mother-last_name">Last name:</label> <input type="text" name="mother-last_name" id="id_mother-last_name" required></li>
>>> print(father.as_ul())
- <li><label for="id_father-first_name">First name:</label> <input type="text" name="father-first_name" id="id_father-first_name" required /></li>
- <li><label for="id_father-last_name">Last name:</label> <input type="text" name="father-last_name" id="id_father-last_name" required /></li>
+ <li><label for="id_father-first_name">First name:</label> <input type="text" name="father-first_name" id="id_father-first_name" required></li>
+ <li><label for="id_father-last_name">Last name:</label> <input type="text" name="father-last_name" id="id_father-last_name" required></li>
The prefix can also be specified on the form class::
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt
index 6c24c3534e..65a231d8e2 100644
--- a/docs/ref/forms/fields.txt
+++ b/docs/ref/forms/fields.txt
@@ -119,9 +119,9 @@ We've specified ``auto_id=False`` to simplify the output::
... comment = forms.CharField()
>>> f = CommentForm(auto_id=False)
>>> print(f)
- <tr><th>Your name:</th><td><input type="text" name="name" required /></td></tr>
- <tr><th>Your website:</th><td><input type="url" name="url" /></td></tr>
- <tr><th>Comment:</th><td><input type="text" name="comment" required /></td></tr>
+ <tr><th>Your name:</th><td><input type="text" name="name" required></td></tr>
+ <tr><th>Your website:</th><td><input type="url" name="url"></td></tr>
+ <tr><th>Comment:</th><td><input type="text" name="comment" required></td></tr>
``label_suffix``
----------------
@@ -137,9 +137,9 @@ The ``label_suffix`` argument lets you override the form's
... captcha_answer = forms.IntegerField(label='2 + 2', label_suffix=' =')
>>> f = ContactForm(label_suffix='?')
>>> print(f.as_p())
- <p><label for="id_age">Age?</label> <input id="id_age" name="age" type="number" required /></p>
- <p><label for="id_nationality">Nationality?</label> <input id="id_nationality" name="nationality" type="text" required /></p>
- <p><label for="id_captcha_answer">2 + 2 =</label> <input id="id_captcha_answer" name="captcha_answer" type="number" required /></p>
+ <p><label for="id_age">Age?</label> <input id="id_age" name="age" type="number" required></p>
+ <p><label for="id_nationality">Nationality?</label> <input id="id_nationality" name="nationality" type="text" required></p>
+ <p><label for="id_captcha_answer">2 + 2 =</label> <input id="id_captcha_answer" name="captcha_answer" type="number" required></p>
``initial``
-----------
@@ -161,9 +161,9 @@ field is initialized to a particular value. For example::
... comment = forms.CharField()
>>> f = CommentForm(auto_id=False)
>>> print(f)
- <tr><th>Name:</th><td><input type="text" name="name" value="Your name" required /></td></tr>
- <tr><th>Url:</th><td><input type="url" name="url" value="http://" required /></td></tr>
- <tr><th>Comment:</th><td><input type="text" name="comment" required /></td></tr>
+ <tr><th>Name:</th><td><input type="text" name="name" value="Your name" required></td></tr>
+ <tr><th>Url:</th><td><input type="url" name="url" value="http://" required></td></tr>
+ <tr><th>Comment:</th><td><input type="text" name="comment" required></td></tr>
You may be thinking, why not just pass a dictionary of the initial values as
data when displaying the form? Well, if you do that, you'll trigger validation,
@@ -176,9 +176,9 @@ and the HTML output will include any validation errors::
>>> default_data = {'name': 'Your name', 'url': 'http://'}
>>> f = CommentForm(default_data, auto_id=False)
>>> print(f)
- <tr><th>Name:</th><td><input type="text" name="name" value="Your name" required /></td></tr>
- <tr><th>Url:</th><td><ul class="errorlist"><li>Enter a valid URL.</li></ul><input type="url" name="url" value="http://" required /></td></tr>
- <tr><th>Comment:</th><td><ul class="errorlist"><li>This field is required.</li></ul><input type="text" name="comment" required /></td></tr>
+ <tr><th>Name:</th><td><input type="text" name="name" value="Your name" required></td></tr>
+ <tr><th>Url:</th><td><ul class="errorlist"><li>Enter a valid URL.</li></ul><input type="url" name="url" value="http://" required></td></tr>
+ <tr><th>Comment:</th><td><ul class="errorlist"><li>This field is required.</li></ul><input type="text" name="comment" required></td></tr>
This is why ``initial`` values are only displayed for unbound forms. For bound
forms, the HTML output will use the bound data.
@@ -205,7 +205,7 @@ Instead of a constant, you can also pass any callable::
>>> class DateForm(forms.Form):
... day = forms.DateField(initial=datetime.date.today)
>>> print(DateForm())
- <tr><th>Day:</th><td><input type="text" name="day" value="12/23/2008" required /><td></tr>
+ <tr><th>Day:</th><td><input type="text" name="day" value="12/23/2008" required><td></tr>
The callable will be evaluated only when the unbound form is displayed, not when it is defined.
@@ -241,20 +241,20 @@ fields. We've specified ``auto_id=False`` to simplify the output::
... cc_myself = forms.BooleanField(required=False)
>>> f = HelpTextContactForm(auto_id=False)
>>> print(f.as_table())
- <tr><th>Subject:</th><td><input type="text" name="subject" maxlength="100" required /><br /><span class="helptext">100 characters max.</span></td></tr>
- <tr><th>Message:</th><td><input type="text" name="message" required /></td></tr>
- <tr><th>Sender:</th><td><input type="email" name="sender" required /><br />A valid email address, please.</td></tr>
- <tr><th>Cc myself:</th><td><input type="checkbox" name="cc_myself" /></td></tr>
+ <tr><th>Subject:</th><td><input type="text" name="subject" maxlength="100" required><br><span class="helptext">100 characters max.</span></td></tr>
+ <tr><th>Message:</th><td><input type="text" name="message" required></td></tr>
+ <tr><th>Sender:</th><td><input type="email" name="sender" required><br>A valid email address, please.</td></tr>
+ <tr><th>Cc myself:</th><td><input type="checkbox" name="cc_myself"></td></tr>
>>> print(f.as_ul()))
- <li>Subject: <input type="text" name="subject" maxlength="100" required /> <span class="helptext">100 characters max.</span></li>
- <li>Message: <input type="text" name="message" required /></li>
- <li>Sender: <input type="email" name="sender" required /> A valid email address, please.</li>
- <li>Cc myself: <input type="checkbox" name="cc_myself" /></li>
+ <li>Subject: <input type="text" name="subject" maxlength="100" required> <span class="helptext">100 characters max.</span></li>
+ <li>Message: <input type="text" name="message" required></li>
+ <li>Sender: <input type="email" name="sender" required> A valid email address, please.</li>
+ <li>Cc myself: <input type="checkbox" name="cc_myself"></li>
>>> print(f.as_p())
- <p>Subject: <input type="text" name="subject" maxlength="100" required /> <span class="helptext">100 characters max.</span></p>
- <p>Message: <input type="text" name="message" required /></p>
- <p>Sender: <input type="email" name="sender" required /> A valid email address, please.</p>
- <p>Cc myself: <input type="checkbox" name="cc_myself" /></p>
+ <p>Subject: <input type="text" name="subject" maxlength="100" required> <span class="helptext">100 characters max.</span></p>
+ <p>Message: <input type="text" name="message" required></p>
+ <p>Sender: <input type="email" name="sender" required> A valid email address, please.</p>
+ <p>Cc myself: <input type="checkbox" name="cc_myself"></p>
``error_messages``
------------------
diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt
index dc6256ee06..ee913f0f72 100644
--- a/docs/ref/forms/widgets.txt
+++ b/docs/ref/forms/widgets.txt
@@ -142,9 +142,9 @@ provided for each widget will be rendered exactly the same::
>>> f = CommentForm(auto_id=False)
>>> f.as_table()
- <tr><th>Name:</th><td><input type="text" name="name" required /></td></tr>
- <tr><th>Url:</th><td><input type="url" name="url" required /></td></tr>
- <tr><th>Comment:</th><td><input type="text" name="comment" required /></td></tr>
+ <tr><th>Name:</th><td><input type="text" name="name" required></td></tr>
+ <tr><th>Url:</th><td><input type="url" name="url" required></td></tr>
+ <tr><th>Comment:</th><td><input type="text" name="comment" required></td></tr>
On a real Web page, you probably don't want every widget to look the same. You
might want a larger input element for the comment, and you might want the
@@ -161,9 +161,9 @@ Django will then include the extra attributes in the rendered output:
>>> f = CommentForm(auto_id=False)
>>> f.as_table()
- <tr><th>Name:</th><td><input type="text" name="name" class="special" required /></td></tr>
- <tr><th>Url:</th><td><input type="url" name="url" required /></td></tr>
- <tr><th>Comment:</th><td><input type="text" name="comment" size="40" required /></td></tr>
+ <tr><th>Name:</th><td><input type="text" name="name" class="special" required></td></tr>
+ <tr><th>Url:</th><td><input type="url" name="url" required></td></tr>
+ <tr><th>Comment:</th><td><input type="text" name="comment" size="40" required></td></tr>
You can also set the HTML ``id`` using :attr:`~Widget.attrs`. See
:attr:`BoundField.id_for_label` for an example.
@@ -211,18 +211,18 @@ foundation for custom widgets.
>>> from django import forms
>>> name = forms.TextInput(attrs={'size': 10, 'title': 'Your name',})
>>> name.render('name', 'A name')
- '<input title="Your name" type="text" name="name" value="A name" size="10" required />'
+ '<input title="Your name" type="text" name="name" value="A name" size="10" required>'
If you assign a value of ``True`` or ``False`` to an attribute,
it will be rendered as an HTML5 boolean attribute::
>>> name = forms.TextInput(attrs={'required': True})
>>> name.render('name', 'A name')
- '<input name="name" type="text" value="A name" required />'
+ '<input name="name" type="text" value="A name" required>'
>>>
>>> name = forms.TextInput(attrs={'required': False})
>>> name.render('name', 'A name')
- '<input name="name" type="text" value="A name" />'
+ '<input name="name" type="text" value="A name">'
.. attribute:: Widget.supports_microseconds
@@ -701,16 +701,16 @@ that specifies the template used to render each choice. For example, for the
.. code-block:: html
<div class="myradio">
- <label for="id_beatles_0"><input id="id_beatles_0" name="beatles" type="radio" value="john" required /> John</label>
+ <label for="id_beatles_0"><input id="id_beatles_0" name="beatles" type="radio" value="john" required> John</label>
</div>
<div class="myradio">
- <label for="id_beatles_1"><input id="id_beatles_1" name="beatles" type="radio" value="paul" required /> Paul</label>
+ <label for="id_beatles_1"><input id="id_beatles_1" name="beatles" type="radio" value="paul" required> Paul</label>
</div>
<div class="myradio">
- <label for="id_beatles_2"><input id="id_beatles_2" name="beatles" type="radio" value="george" required /> George</label>
+ <label for="id_beatles_2"><input id="id_beatles_2" name="beatles" type="radio" value="george" required> George</label>
</div>
<div class="myradio">
- <label for="id_beatles_3"><input id="id_beatles_3" name="beatles" type="radio" value="ringo" required /> Ringo</label>
+ <label for="id_beatles_3"><input id="id_beatles_3" name="beatles" type="radio" value="ringo" required> Ringo</label>
</div>
That included the ``<label>`` tags. To get more granular, you can use each
@@ -732,22 +732,22 @@ that specifies the template used to render each choice. For example, for the
<label for="id_beatles_0">
John
- <span class="radio"><input id="id_beatles_0" name="beatles" type="radio" value="john" required /></span>
+ <span class="radio"><input id="id_beatles_0" name="beatles" type="radio" value="john" required></span>
</label>
<label for="id_beatles_1">
Paul
- <span class="radio"><input id="id_beatles_1" name="beatles" type="radio" value="paul" required /></span>
+ <span class="radio"><input id="id_beatles_1" name="beatles" type="radio" value="paul" required></span>
</label>
<label for="id_beatles_2">
George
- <span class="radio"><input id="id_beatles_2" name="beatles" type="radio" value="george" required /></span>
+ <span class="radio"><input id="id_beatles_2" name="beatles" type="radio" value="george" required></span>
</label>
<label for="id_beatles_3">
Ringo
- <span class="radio"><input id="id_beatles_3" name="beatles" type="radio" value="ringo" required /></span>
+ <span class="radio"><input id="id_beatles_3" name="beatles" type="radio" value="ringo" required></span>
</label>
If you decide not to loop over the radio buttons -- e.g., if your template
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt
index bc870b101b..e2e8e4cec1 100644
--- a/docs/ref/request-response.txt
+++ b/docs/ref/request-response.txt
@@ -124,7 +124,7 @@ All attributes should be considered read-only, unless stated otherwise.
.. attribute:: HttpRequest.FILES
A dictionary-like object containing all uploaded files. Each key in
- ``FILES`` is the ``name`` from the ``<input type="file" name="" />``. Each
+ ``FILES`` is the ``name`` from the ``<input type="file" name="">``. Each
value in ``FILES`` is an :class:`~django.core.files.uploadedfile.UploadedFile`.
See :doc:`/topics/files` for more information.
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index ec05d16292..6f37b04320 100644
--- a/docs/ref/templates/builtins.txt
+++ b/docs/ref/templates/builtins.txt
@@ -1192,7 +1192,7 @@ value to a maximum value, and then applies that ratio to a constant.
For example::
<img src="bar.png" alt="Bar"
- height="10" width="{% widthratio this_value max_value max_width %}" />
+ height="10" width="{% widthratio this_value max_value max_width %}">
If ``this_value`` is 175, ``max_value`` is 200, and ``max_width`` is 100, the
image in the above example will be 88 pixels wide
@@ -1832,14 +1832,14 @@ If ``value`` is ``['a', 'b', 'c', 'd']`` or ``"abcd"``, the output will be
--------------
Replaces line breaks in plain text with appropriate HTML; a single
-newline becomes an HTML line break (``<br />``) and a new line
+newline becomes an HTML line break (``<br>``) and a new line
followed by a blank line becomes a paragraph break (``</p>``).
For example::
{{ value|linebreaks }}
-If ``value`` is ``Joel\nis a slug``, the output will be ``<p>Joel<br />is a
+If ``value`` is ``Joel\nis a slug``, the output will be ``<p>Joel<br>is a
slug</p>``.
.. templatefilter:: linebreaksbr
@@ -1848,13 +1848,13 @@ slug</p>``.
----------------
Converts all newlines in a piece of plain text to HTML line breaks
-(``<br />``).
+(``<br>``).
For example::
{{ value|linebreaksbr }}
-If ``value`` is ``Joel\nis a slug``, the output will be ``Joel<br />is a
+If ``value`` is ``Joel\nis a slug``, the output will be ``Joel<br>is a
slug``.
.. templatefilter:: linenumbers
@@ -2531,20 +2531,20 @@ app is installed, the tag will serve files using ``url()`` method of the
storage specified by :setting:`STATICFILES_STORAGE`. For example::
{% load static %}
- <img src="{% static "images/hi.jpg" %}" alt="Hi!" />
+ <img src="{% static "images/hi.jpg" %}" alt="Hi!">
It is also able to consume standard context variables, e.g. assuming a
``user_stylesheet`` variable is passed to the template::
{% load static %}
- <link rel="stylesheet" href="{% static user_stylesheet %}" type="text/css" media="screen" />
+ <link rel="stylesheet" href="{% static user_stylesheet %}" type="text/css" media="screen">
If you'd like to retrieve a static URL without displaying it, you can use a
slightly different call::
{% load static %}
{% static "images/hi.jpg" as myphoto %}
- <img src="{{ myphoto }}"></img>
+ <img src="{{ myphoto }}">
.. admonition:: Using Jinja2 templates?
@@ -2561,7 +2561,7 @@ over exactly where and how :setting:`STATIC_URL` is injected into the template,
you can use the :ttag:`get_static_prefix` template tag::
{% load static %}
- <img src="{% get_static_prefix %}images/hi.jpg" alt="Hi!" />
+ <img src="{% get_static_prefix %}images/hi.jpg" alt="Hi!">
There's also a second form you can use to avoid extra processing if you need
the value multiple times::
@@ -2569,8 +2569,8 @@ the value multiple times::
{% load static %}
{% get_static_prefix as STATIC_PREFIX %}
- <img src="{{ STATIC_PREFIX }}images/hi.jpg" alt="Hi!" />
- <img src="{{ STATIC_PREFIX }}images/hi2.jpg" alt="Hello!" />
+ <img src="{{ STATIC_PREFIX }}images/hi.jpg" alt="Hi!">
+ <img src="{{ STATIC_PREFIX }}images/hi2.jpg" alt="Hello!">
.. templatetag:: get_media_prefix
diff --git a/docs/ref/templates/language.txt b/docs/ref/templates/language.txt
index 806832e061..c6ce3b3dfd 100644
--- a/docs/ref/templates/language.txt
+++ b/docs/ref/templates/language.txt
@@ -291,7 +291,7 @@ It's easiest to understand template inheritance by starting with an example::
<!DOCTYPE html>
<html lang="en">
<head>
- <link rel="stylesheet" href="style.css" />
+ <link rel="stylesheet" href="style.css">
<title>{% block title %}My amazing site{% endblock %}</title>
</head>
@@ -344,7 +344,7 @@ like::
<!DOCTYPE html>
<html lang="en">
<head>
- <link rel="stylesheet" href="style.css" />
+ <link rel="stylesheet" href="style.css">
<title>My amazing blog</title>
</head>