[wp-trac] [WordPress Trac] #28951: Caption shortcode `class` attribute stripped by TinyMCE

WordPress Trac noreply at wordpress.org
Mon Aug 4 21:56:13 UTC 2014


#28951: Caption shortcode `class` attribute stripped by TinyMCE
---------------------------------+-----------------------------------------
 Reporter:  dominicp             |       Owner:  azaozz
     Type:  defect (bug)         |      Status:  reviewing
 Priority:  normal               |   Milestone:  4.0
Component:  Editor               |     Version:  3.9.1
 Severity:  normal               |  Resolution:
 Keywords:  dev-feedback has-    |     Focuses:  javascript, administration
  patch                          |
---------------------------------+-----------------------------------------

Comment (by kadamwhite):

 This patch looks good, but I've altered the name of the new variable to be
 <code>align</code> (for readability); made the regex for the alignment
 class case-insensitive; and standardized the whitespace around + operators
 within the lines touched by the path.

 The reasoning for making the regex case-insensitive is that putting in
 mis-cased values into the 'align' attribute was causing an issue where the
 invalid attribute value and "wp-class" would get inserted into the user's
 custom class. Invalid alignment values (e.g.
 <code>align="sideways"</code>) will still trigger this behavior, and that
 may be inevitable, but making the regex case-insensitive was a quick way
 to mitigate it without altering the functionality of the patch.

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


More information about the wp-trac mailing list