File tree Expand file tree Collapse file tree
tests/phpunit/tests/html-api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -416,7 +416,12 @@ public function next_tag( $query = null ) {
416416 /**
417417 * Steps through the HTML document and stop at the next token, if any.
418418 *
419- * Currently only supports stepping through tags.
419+ * Currently only supports stepping through tags; do not use until this
420+ * supports visiting text nodes. This is necessary for now to ensure that
421+ * the Tag Processor doesn't bypass the HTML semantic rules in this class
422+ * when seeking to a bookmark.
423+ *
424+ * @access private
420425 *
421426 * @return bool
422427 */
Original file line number Diff line number Diff line change @@ -515,7 +515,11 @@ public function test_can_query_an_element_by_tag_name() {
515515 * @covers WP_HTML_Processor::seek
516516 */
517517 public function test_can_seek_back_and_forth () {
518- $ p = WP_HTML_Processor::create_fragment ( '<div><p one><div><p><div two><p><div><p><div><p three> ' );
518+ $ p = WP_HTML_Processor::create_fragment (
519+ <<<'HTML'
520+ <div>text<p one>more stuff<div><![CDATA[this is not real CDATA]]><p><!-- hi --><div two><p><div><p>three comes soon<div><p three>' );
521+ HTML
522+ );
519523
520524 // Find first tag of interest.
521525 while ( $ p ->next_tag () && null === $ p ->get_attribute ( 'one ' ) ) {
You can’t perform that action at this time.
0 commit comments