[wp-trac] [WordPress Trac] #62290: Unable to seek to any bookmark in HTML Processor

WordPress Trac noreply at wordpress.org
Mon Oct 28 16:05:54 UTC 2024


#62290: Unable to seek to any bookmark in HTML Processor
--------------------------------------+---------------------
 Reporter:  westonruter               |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  6.7.1
Component:  HTML API                  |     Version:  6.6
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------

Comment (by mi5t4n):

 @westonruter Yes, I am getting similar errors as yours in the
 `6.8-alpha-59274-src` trunk. But, the reason `create_fragment` is failing,
 maybe because `create_fragment()` is not intended to parse the whole HTML
 document, rather than parts which appears inside the `<body>` element.


 `create_fragment()` DOC.


 {{{
 File: src/wp-includes/html-api/class-wp-html-processor.php
 266:     * Use this for cases where you are processing chunks of HTML that
 267:     * will be found within a bigger HTML document, such as rendered
 268:     * block output that exists within a post, `the_content` inside a
 269:     * rendered site layout.
 }}}





 {{{create_fragment()}}} signature.
 {{{
 File: src/wp-includes/html-api/class-wp-html-processor.php
 295:    public static function create_fragment( $html, $context =
 '<body>', $encoding = 'UTF-8' ) {
 296:            if ( '<body>' !== $context || 'UTF-8' !== $encoding ) {
 297:                    return null;
 298:            }
 }}}

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


More information about the wp-trac mailing list