[wp-trac] [WordPress Trac] #60092: HTML API: HTML parser should fail parsing unsupported tags

WordPress Trac noreply at wordpress.org
Mon Jan 8 14:03:58 UTC 2024


#60092: HTML API: HTML parser should fail parsing unsupported tags
---------------------------------------------+-------------------------
 Reporter:  jonsurrell                       |       Owner:  jonsurrell
     Type:  enhancement                      |      Status:  closed
 Priority:  normal                           |   Milestone:  6.5
Component:  HTML API                         |     Version:  trunk
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+-------------------------
Changes (by Bernhard Reiter):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"57248" 57248]:
 {{{
 #!CommitTicketReference repository="" revision="57248"
 HTML API: Add explicit handling or failure for all tags.

 The HTML API HTML processor does not yet support all tags. Many tags (e.g.
 list elements) have some complicated rules in the
 [https://html.spec.whatwg.org/#parsing-main-inbody "in body" insertion
 mode].

 Implementing these special rules is blocking the implementation for a
 catch-all rule for "any other tag" because we need to prevent special
 rules from being handled by the catch-all.

   Any other start tag
   Reconstruct the active formatting elements, if any.

   Insert an HTML element for the token.

   …

 This change ensures the HTML Processor fails when handling special tags.
 This is the same as existing behavior, but will allow us to implement the
 catch-all "any other tag" handling without unintentionally handling
 special elements.

 Additionally, we add tests that assert the special elements are unhandled.
 As these tags are implemented, this should help to ensure they're removed
 from the unsupported tag list.

 Props jonsurrell, dmsnell.
 Fixes #60092.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60092#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list