diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2017-11-26 10:23:34 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2017-11-26 10:25:13 +0100 |
commit | 6b1d593ec841ebe18dcbdd18902f7faad0868fd4 (patch) | |
tree | f437aa9275f93492d5a860fb1790cb59d2d2e5a5 /crocoite/html.py | |
parent | ee736e28ed4c5cdae395f5851eb2bad96d8078ef (diff) | |
download | crocoite-6b1d593ec841ebe18dcbdd18902f7faad0868fd4.tar.gz crocoite-6b1d593ec841ebe18dcbdd18902f7faad0868fd4.tar.bz2 crocoite-6b1d593ec841ebe18dcbdd18902f7faad0868fd4.zip |
DOM snapshot: Generate valid HTML5
Some tags are “void”, i.e. cannot contain contents and don’t have a
closing tag.
Diffstat (limited to 'crocoite/html.py')
-rw-r--r-- | crocoite/html.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/crocoite/html.py b/crocoite/html.py index 75ac022..34fe26b 100644 --- a/crocoite/html.py +++ b/crocoite/html.py @@ -18,8 +18,24 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. +# HTML void tags, see https://html.spec.whatwg.org/multipage/syntax.html#void-elements +voidTags = {'area', + 'base', + 'br', + 'col', + 'embed', + 'hr', + 'img', + 'input', + 'link', + 'meta', + 'param', + 'source', + 'track', + 'wbr'} + # source: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes -eventAttributes = ['onabort', +eventAttributes = {'onabort', 'onautocomplete', 'onautocompleteerror', 'onblur', @@ -81,4 +97,5 @@ eventAttributes = ['onabort', 'ontimeupdate', 'ontoggle', 'onvolumechange', - 'onwaiting'] + 'onwaiting'} + |