[wp-trac] [WordPress Trac] #8912: wptexturize malforms HTML comments that contain HTML tags

WordPress Trac wp-trac at lists.automattic.com
Thu Apr 12 00:46:27 UTC 2012


#8912: wptexturize malforms HTML comments that contain HTML tags
-------------------------------------------------+-------------------------
 Reporter:  Otto42                               |       Owner:  anonymous
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  Future
Component:  Formatting                           |  Release
 Severity:  normal                               |     Version:  2.7
 Keywords:  has-patch needs-refresh needs-unit-  |  Resolution:
  tests                                          |
-------------------------------------------------+-------------------------
Changes (by cgrymala):

 * cc: curtiss@… (added)


Comment:

 I've come across a new wrinkle in this issue that I haven't seen mentioned
 yet. HTML comments around entire lines (or groups of lines) occasionally
 causes those lines to be deleted altogether (and the HTML structure to get
 messed up) when switching between the HTML editor and the Visual Editor.

 Take the following code for example:

 {{{
 <ol>
         <li>List Item 1</li>
         <li>List Item 2</li>
         <li>List Item 3</li>
 </ol>
 }}}

 Now, add an HTML comment like so:

 {{{
 <ol>
         <li>List Item 1</li>
 <!--    <li>List Item 2</li>-->
         <li>List Item 3</li>
 </ol>
 }}}

 Then, switch to the visual editor and switch back to the HTML editor.
 You're left with the following:


 {{{
 <ol>
 <ol>
         <li>List Item 1</li>
 </ol>
 </ol>
 &nbsp;
 <ol>
         <li>List Item 3</li>
 </ol>
 }}}

 As another example, if you take the following HTML:

 {{{
 List Item 1

 <strong>List Item 2</strong>

 List Item 3
 }}}

 Then, add an HTML comment like:

 {{{
 List Item 1

 <!--<strong>List Item 2</strong>-->

 List Item 3
 }}}

 Then, switch back to the visual editor and back to the HTML editor again,
 and you're left with the following code in the HTML editor:

 {{{
 List Item 1

 &nbsp;

 List Item 3
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/8912#comment:27>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list