From 7c3732a1b47bb736ccfd8302aa55e6cf41edff7e Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Fri, 10 May 2019 03:04:07 -0700 Subject: 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 --- django/test/html.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'django') 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__() -- cgit v1.3