html5-php icon indicating copy to clipboard operation
html5-php copied to clipboard

Continue parsing as data after invalid opening tag

Open bsweeney opened this issue 1 year ago • 3 comments

Per section 8.2.4.1 of spec version 20141028:

Parse error. Switch to the data state. Emit a U+003C LESS-THAN SIGN character token. Reconsume the current input character.

Note: the 20141028 version of the spec was used because the section numbering matches up with existing references in code. The relevant section for the living HTML5 spec is 13.2.5.1 and provides similar guidance.

fixes #250

bsweeney avatar Aug 07 '24 04:08 bsweeney

up please 🙏

benoit-waldmann avatar Aug 26 '24 15:08 benoit-waldmann

Note: the 20141028 version of the spec was used because the section numbering matches up with existing references in code. The relevant section for the living HTML5 spec is 13.2.5.1 and provides similar guidance.

I think it's 13.2.5.6 Tag open state, isn't it?

Anything else: This is an invalid-first-character-of-tag-name parse error. Emit a U+003C LESS-THAN SIGN character token. Reconsume in the data state.

The consequences are the same (adding <), which seems to be fine.

ohader avatar Sep 05 '24 09:09 ohader

Note: the 20141028 version of the spec was used because the section numbering matches up with existing references in code. The relevant section for the living HTML5 spec is 13.2.5.1 and provides similar guidance.

I think it's 13.2.5.6 Tag open state, isn't it?

Anything else: This is an invalid-first-character-of-tag-name parse error. Emit a U+003C LESS-THAN SIGN character token. Reconsume in the data state.

The consequences are the same (adding <), which seems to be fine.

I was attempting to address issues consuming the < while in data state. As noted in my other comment, there are indeed still issues to resolve with tag name and attribute name states.

bsweeney avatar Sep 05 '24 12:09 bsweeney