summaryrefslogtreecommitdiff
path: root/django/test/html.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-05-10 03:04:07 -0700
committerCarlton Gibson <carlton.gibson@noumenal.es>2019-05-10 12:04:07 +0200
commit7c3732a1b47bb736ccfd8302aa55e6cf41edff7e (patch)
tree7567b876bda3b9164f5929907263447ab31343ef /django/test/html.py
parentb7a33ee4f0f20e5b7e3dcd72d9b0c4c342c7f147 (diff)
Fixed #30470 -- Added assertHTMLEqual() support for all self closing tags.
Support for the following tags was added: area, embed, param, track, and wbr. The full list of self closing tags is documented at: https://html.spec.whatwg.org/#void-elements
Diffstat (limited to 'django/test/html.py')
-rw-r--r--django/test/html.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/django/test/html.py b/django/test/html.py
index b238fd48d9..511c08bb26 100644
--- a/django/test/html.py
+++ b/django/test/html.py
@@ -141,10 +141,13 @@ class HTMLParseError(Exception):
class Parser(HTMLParser):
- SELF_CLOSING_TAGS = (
- 'br', 'hr', 'input', 'img', 'meta', 'spacer', 'link', 'frame', 'base',
- 'col',
- )
+ # https://html.spec.whatwg.org/#void-elements
+ SELF_CLOSING_TAGS = {
+ 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta',
+ 'param', 'source', 'track', 'wbr',
+ # Deprecated tags
+ 'frame', 'spacer',
+ }
def __init__(self):
super().__init__()