[wp-trac] [WordPress Trac] #62270: Unable to set bookmark on </body> in WP_HTML_Processor

WordPress Trac noreply at wordpress.org
Wed Oct 23 18:14:44 UTC 2024


#62270: Unable to set bookmark on </body> in WP_HTML_Processor
----------------------------+------------------------------
 Reporter:  westonruter     |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  HTML API        |     Version:  6.4
 Severity:  normal          |  Resolution:
 Keywords:  has-unit-tests  |     Focuses:
----------------------------+------------------------------

Comment (by jonsurrell):

 > In my subclass, if a bookmark is unable to be set on </body> then it
 could just opt to append the injected content at the end of the document
 after </html> instead of inserting it at the desired bookmark before
 </body>.

 I was going to suggest something along these lines as a workaround. I
 think the only cases it would get wrong if a comment appears in the
 injected HTML before other elements or non-whitespace text. Anything else
 should be placed in the body element. It won't make the prettiest HTML,
 but it should work 🙂

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


More information about the wp-trac mailing list