From 95ae37839c907d7d030f1387a003a5776593d7d7 Mon Sep 17 00:00:00 2001 From: Nick Pope Date: Thu, 14 Mar 2024 04:56:22 +0000 Subject: [PATCH] Refs #30686 -- Made django.utils.html.VOID_ELEMENTS a frozenset. --- django/utils/html.py | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/django/utils/html.py b/django/utils/html.py index 06e8824f5632..22d3ae42fabd 100644 --- a/django/utils/html.py +++ b/django/utils/html.py @@ -16,25 +16,27 @@ 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", -} +VOID_ELEMENTS = frozenset( + ( + "area", + "base", + "br", + "col", + "embed", + "hr", + "img", + "input", + "link", + "meta", + "param", + "source", + "track", + "wbr", + # Deprecated tags. + "frame", + "spacer", + ) +) @keep_lazy(SafeString)