Skip to content

Commit acdbdc1

Browse files
authored
Update list of empty HTML tags
Use Python standard library's HTML_EMPTY which already contains the new tags. Fixes #1353.
1 parent f50ac47 commit acdbdc1

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

docs/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ links to the header, placing them after all other header content.
2525
* Add support for cPython version 3.12 (and PyPy 3.10) and drop support for
2626
Python version 3.7 (#1357).
2727
* Refactor changelog to use the format defined at <https://keepachangelog.com/>.
28+
* Updated the list of empty HTML tags (#1353).
2829

2930
## [3.4.4] -- 2023-07-25
3031

markdown/serializers.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,14 @@
3434
# OF THIS SOFTWARE.
3535
# --------------------------------------------------------------------
3636

37-
3837
from xml.etree.ElementTree import ProcessingInstruction
39-
from xml.etree.ElementTree import Comment, ElementTree, QName
38+
from xml.etree.ElementTree import Comment, ElementTree, QName, HTML_EMPTY
4039
import re
4140

4241
__all__ = ['to_html_string', 'to_xhtml_string']
4342

44-
HTML_EMPTY = ("area", "base", "basefont", "br", "col", "frame", "hr",
45-
"img", "input", "isindex", "link", "meta", "param")
4643
RE_AMP = re.compile(r'&(?!(?:\#[0-9]+|\#x[0-9a-f]+|[0-9a-z]+);)', re.I)
4744

48-
try:
49-
HTML_EMPTY = set(HTML_EMPTY)
50-
except NameError: # pragma: no cover
51-
pass
52-
5345

5446
def _raise_serialization_error(text): # pragma: no cover
5547
raise TypeError(

0 commit comments

Comments
 (0)