-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HTML: track the form element pointer
This is done for a (more-)correct behavior on an unmatched </form> tag. The actual behavior is not quite right: when a form element is closed, implied end tags are correctly generated for dd, dt, li, option, optgroup, rb, rp, rt, rtc elements. If the element on the top of the stack is not then the form element being closed, the specification says to simply remove it from the stack. This leaves the Markup.ml streaming parser unable to generate a proper `End_element signal for it: - If the signal is generated immediately, it will break nesting of the signal stream, as the element on top of the stack has been opened, and suddenly we are closing its ancestor form element. - If the signal is not generated immediately, this will not accomplish closing the form element, until its lingering presence triggers an unrelated error, and it is closed haphazardly at a later point. Note that this entire situation is a parse error to begin with, and should not occur for correct markup. This commit chooses to generate the signal immediately, but after first closing all elements until the form element is reached, to preserve nesting. This may result in early closing of (wrongly) unclosed elements inside a form, in some error recovery scenarios. Fixes aantron/lambdasoup#10.
- Loading branch information
Showing
2 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters