[wp-trac] [WordPress Trac] #64394: HTML Processor may error processing nested HTML structures

WordPress Trac noreply at wordpress.org
Wed Dec 10 16:27:58 UTC 2025


#64394: HTML Processor may error processing nested HTML structures
--------------------------+------------------------------
 Reporter:  jonsurrell    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  HTML API      |     Version:  6.4
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by jonsurrell):

 Nesting is the most obvious way for the error to happen. Internally, each
 element on the stack of open elements gets a bookmark. When nesting causes
 the stack to have more bookmarks than are allowed, this error is
 triggered.

 Internal and user bookmarks are shared, so if many bookmarks are being set
 externally it would lower the nesting threshold for triggering this error.

 There are also bookmarks associated with virtual tokens, but that's a form
 of nesting. For example `<table><td>` is apparently 2 tags, but when
 processed via `::create_fragment()` this actually consumes a maximum of 6
 bookmarks I believe. 2 bookmarks for the root and context (`HTML > BODY`)
 then 4 more elements (`TABLE > TBODY (virtual) > TR (virtual) > TD`).

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


More information about the wp-trac mailing list