Skip to content

Commit

Permalink
Sort void elements alphabetically, document ones that don't match cur…
Browse files Browse the repository at this point in the history
…rent standard (#563)
  • Loading branch information
ambv committed Mar 2, 2023
1 parent 6ca0244 commit 82047b0
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions html5lib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,24 +557,36 @@
)

voidElements = frozenset([
"area",
"base",
"command",
"event-source",
"link",
"meta",
"hr",
"br",
"img",
"embed",
"param",
"area",
"col",
"command", # removed ^1
"embed",
"event-source", # renamed and later removed ^2
"hr",
"img",
"input",
"link",
"meta",
"param", # deprecated ^3
"source",
"track",
"wbr",
])

# Removals and deprecations in the HTML 5 spec:
# ^1: command
# http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-December/038472.html
# https://github.com/whatwg/html/commit/9e2e25f4ae90969a7c64e0763c98548a35b50af8
# ^2: event-source
# renamed to eventsource in 7/2008:
# https://github.com/whatwg/html/commit/d157945d0285b4463a04b57318da0c4b300a99e7
# removed entirely in 2/2009:
# https://github.com/whatwg/html/commit/43cbdbfbb7eb74b0d65e0f4caab2020c0b2a16ff
# ^3: param
# https://developer.mozilla.org/en-US/docs/Web/HTML/Element/param

cdataElements = frozenset(['title', 'textarea'])

rcdataElements = frozenset([
Expand Down

0 comments on commit 82047b0

Please sign in to comment.