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

WordPress Trac noreply at wordpress.org
Mon Dec 18 10:15:22 UTC 2023


#60092: HTML API: HTML parser should fail parsing unsupported tags
-------------------------+-----------------------------
 Reporter:  jonsurrell   |      Owner:  jonsurrell
     Type:  enhancement  |     Status:  assigned
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  HTML API     |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 The HTML API HTML processor does not yet support all tags. Many tags have
 some complicated rules in the [https://html.spec.whatwg.org/#parsing-main-
 inbody "in body" insertion mode]. For example, list elements are
 implemented in [https://github.com/WordPress/wordpress-develop/pull/5539
 PR 5539.

 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 they tags are implemented, this should help to ensure they're removed
 from the unsupported tag list.

 This is part of https://github.com/WordPress/gutenberg/discussions/54579.

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


More information about the wp-trac mailing list