[wp-trac] [WordPress Trac] #25473: wp_text_diff creates wrong number of columns if title arguments are set

WordPress Trac noreply at wordpress.org
Fri May 10 21:33:29 UTC 2019


#25473: wp_text_diff creates wrong number of columns if title arguments are set
-------------------------------------+-----------------------------
 Reporter:  joedolson                |       Owner:  (none)
     Type:  defect (bug)             |      Status:  reopened
 Priority:  normal                   |   Milestone:  Future Release
Component:  Revisions                |     Version:  3.6.1
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  accessibility
-------------------------------------+-----------------------------
Changes (by jeremyfelt):

 * focuses:   => accessibility


Comment:

 Can we clarify what the expected markup here should be?

 Right now, we have:

 {{{
 if ( $args['title_left'] || $args['title_right'] ) {
         $r .= "<tr class='diff-sub-title'>\n";
         $r .= "\t<td></td><th>$args[title_left]</th>\n";
         $r .= "\t<td></td><th>$args[title_right]</th>\n";
         $r .= "</tr>\n";
 }
 }}}

 So if `title_left` and/or `title_right` is specified, we end up with the
 possibility of empty HTML tags: `<td></td><th>....</th>`.

 The existing [attachment:"markup-table.diff"] patch on this ticket removes
 the empty `<td>` and adds a `colspan` to the `<th>` element instead. Is
 that an acceptable approach for semantics/accessibility? If so, then I'd
 propose we go for it.

 FWIW: The core revisions interface does not use either of these arguments
 and instead creates another table above the `wp_text_diff()` output to
 display post titles when comparing.

 :wave: @afercia for some input? :)

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


More information about the wp-trac mailing list