[wp-trac] [WordPress Trac] #35514: Shortcodes escape from HTML tables

WordPress Trac noreply at wordpress.org
Mon Jan 18 16:06:55 UTC 2016


#35514: Shortcodes escape from HTML tables
-------------------------------+----------------------------------
 Reporter:  Grzegorz.Janoszka  |      Owner:
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  TinyMCE            |    Version:  4.4.1
 Severity:  normal             |   Keywords:  html table shortcode
  Focuses:                     |
-------------------------------+----------------------------------
 I have WP 4.4.1 and I am trying to use shortcodes with different arguments
 to create repetitive content, like rows in HTML tables. The problem is the
 editor removes the block from between <table> and </table> if it is not
 within <td> or <th> tags.

 Example, I have a shortcode that displays a nice HTML output containing a
 table row starting with <tr> and ending with </tr>.

 I open a new post, go to the text editor and type:
 <table>
 <tbody>
 [tablerow param1=blah param2=blah]
 </tbody>
 </table>

 Then I switch to the visual editor and back to text editor and I see:
 <table>
 <tbody></tbody>
 </table>

 When I try to add some more content to the table, like:
 <table>
 <tbody>
 <tr><td>Initial data</td></tr>
 [tablerow param1=blah param2=blah]
 </tbody>
 </table>

 it is being changed to:
 [tablerow param1=blah param2=blah]
 <table>
 <tbody>
 <tr>
 <td>Initial data</td>
 </tr>
 </tbody>
 </table>

 There is workaround to avoid putting <table> in the editor, but you have
 to use more shortcodes and no HTML code:
 [shortcode with table header]
 [shortcode with table row]
 [shortcode with table row]
 [shortcode with table row]
 [shortcode with table row]
 [shortcode with table footer]

 but it is not very handy.

 Is it possible that shortcodes are not moved out or removed from within
 <table> tags? They may simplify a lot creating repetitive content,
 including tables in Wordpress, but now it is difficult to achieve it with
 shortcodes.

 I think it is related to TinyMCE, so I have assigned this ticket to this
 component. Please feel free to reassign it.

 Thank you in advance for looking into it.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35514>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list