From 6b1d593ec841ebe18dcbdd18902f7faad0868fd4 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sun, 26 Nov 2017 10:23:34 +0100 Subject: DOM snapshot: Generate valid HTML5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some tags are “void”, i.e. cannot contain contents and don’t have a closing tag. --- crocoite/html.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'crocoite/html.py') 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'} + -- cgit v1.2.3