File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1158,10 +1158,7 @@ public function has_class( $wanted_class ) {
11581158 */
11591159 public function set_bookmark ( $ name ) {
11601160 // It only makes sense to set a bookmark if the parser has paused on a concrete token.
1161- if (
1162- self ::STATE_COMPLETE === $ this ->parser_state ||
1163- self ::STATE_INCOMPLETE === $ this ->parser_state
1164- ) {
1161+ if ( self ::STATE_INCOMPLETE === $ this ->parser_state ) {
11651162 return false ;
11661163 }
11671164
@@ -2486,10 +2483,26 @@ public function is_tag_closer() {
24862483 );
24872484 }
24882485
2486+ public function get_node_type () {
2487+ switch ( $ this ->parser_state ) {
2488+ case self ::STATE_MATCHED_TAG :
2489+ return '#tag ' ;
2490+
2491+ case self ::STATE_DOCTYPE :
2492+ return '#doctype ' ;
2493+
2494+ case self ::STATE_PI_NODE :
2495+ return '#processing-instruction ' ;
2496+
2497+ default :
2498+ return $ this ->get_node_name ();
2499+ }
2500+ }
2501+
24892502 public function get_node_name () {
24902503 switch ( $ this ->parser_state ) {
24912504 case self ::STATE_MATCHED_TAG :
2492- return substr ( $ this ->html , $ this -> tag_name_starts_at , $ this -> tag_name_length );
2505+ return $ this ->get_tag ( );
24932506
24942507 case self ::STATE_TEXT_NODE :
24952508 return '#text ' ;
You can’t perform that action at this time.
0 commit comments