File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,10 @@ public function __construct( $string ) {
2626 */
2727 public function process_tokens () {
2828 while ( $ this ->p ->next_token () ) {
29- $ token_type = $ this ->p ->get_token_type ();
30- $ token_name = strtolower ( $ this ->p ->get_token_name () );
31- $ is_tag_closer = $ this ->p ->is_tag_closer ();
29+ $ token_type = $ this ->p ->get_token_type ();
30+ $ token_name = strtolower ( $ this ->p ->get_token_name () );
31+ $ is_tag_closer = $ this ->p ->is_tag_closer ();
32+ $ has_self_closer = $ this ->p ->has_self_closing_flag ();
3233
3334 if ( '#tag ' === $ token_type ) {
3435 $ this ->increment ++;
@@ -51,9 +52,14 @@ public function process_tokens() {
5152 $ token .= $ this ->process_attribute ( $ attr_name , $ attr_value );
5253 }
5354
54- $ token .= '> ' ;
55- $ this ->tokens [] = $ token ;
56- $ this ->translators_note .= $ token_label . " is the start of a ' " . $ token_name . "' HTML element " ;
55+ $ token .= '> ' ;
56+ $ this ->tokens [] = $ token ;
57+
58+ if ( $ has_self_closer || 'br ' === $ token_name ) {
59+ $ this ->translators_note .= $ token_label . " is a ' " . $ token_name . "' HTML element " ;
60+ } else {
61+ $ this ->translators_note .= $ token_label . " is the start of a ' " . $ token_name . "' HTML element " ;
62+ }
5763 }
5864 } else {
5965 // Escape text content.
You can’t perform that action at this time.
0 commit comments