diff --git a/src/document/html/parser/parse.c b/src/document/html/parser/parse.c index a771e809f..76c51ac0a 100644 --- a/src/document/html/parser/parse.c +++ b/src/document/html/parser/parse.c @@ -1224,7 +1224,9 @@ process_element(char *name, int namelen, int endingtag, } } - if (!ei) return html; + if (!ei) { + ei = &elements[NUMBER_OF_TAGS]; + } if (!endingtag) { return start_element(ei, name, namelen, html, eof, attr, html_context); diff --git a/test/none.html b/test/none.html index 28b0e677b..40f12a9d3 100644 --- a/test/none.html +++ b/test/none.html @@ -23,6 +23,7 @@

Paragraph with display: none inline style

Custom element with display: none global style + Other custom element without display: none

div with display: none global style