diff options
| author | David Smith <smithdc@gmail.com> | 2023-07-05 06:51:29 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-07-14 10:25:00 +0200 |
| commit | 1d0dfc0b920916900d2770f3b5640da08af36d97 (patch) | |
| tree | 4989aae4e5faa3e04413161a7914237d7e323797 /django/utils/html.py | |
| parent | 6f1b8c00d8151059cc1902a92f067bbdc1673779 (diff) | |
Refs #30686 -- Moved Parser.SELF_CLOSING_TAGS to django.utils.html.VOID_ELEMENTS
Diffstat (limited to 'django/utils/html.py')
| -rw-r--r-- | django/utils/html.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/django/utils/html.py b/django/utils/html.py index 56d65a8d21..06e8824f56 100644 --- a/django/utils/html.py +++ b/django/utils/html.py @@ -15,6 +15,27 @@ from django.utils.regex_helper import _lazy_re_compile from django.utils.safestring import SafeData, SafeString, mark_safe from django.utils.text import normalize_newlines +# https://html.spec.whatwg.org/#void-elements +VOID_ELEMENTS = { + "area", + "base", + "br", + "col", + "embed", + "hr", + "img", + "input", + "link", + "meta", + "param", + "source", + "track", + "wbr", + # Deprecated tags. + "frame", + "spacer", +} + @keep_lazy(SafeString) def escape(text): |
