[wp-trac] Re: [WordPress Trac] #9437: WordPress munges camelcase inline SVG elements

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 1 14:25:40 GMT 2009


#9437: WordPress munges camelcase inline SVG elements
--------------------------+-------------------------------------------------
 Reporter:  codedread     |       Owner:  anonymous 
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:  2.5       
 Severity:  normal        |    Keywords:  xhtml, svg
--------------------------+-------------------------------------------------

Comment(by codedread):

 Ok, I actually downloaded a local copy of the WordPress trunk and I see
 that things have changed considerably since WP 2.5.

 Now if I edit the HTML tab in the rich editor with:

 <svg xmlns="http://www.w3.org/2000/svg">
     <circle cx="50" cy="50" r="30" fill="blue">
         <animateTransform attributeName="transform" type="scale" to="1.5"
 dur="2s" fill="freeze"/>
     </circle>
 </svg>

 WordPress now munges it into:

 <p><svg xmlns="http://www.w3.org/2000/svg"></p>
 <p><circle cx="50" cy="50" r="30" fill="blue"><br />
 <animateTransform attributeName="transform" type="scale" to="1.5" dur="2s"
 fill="freeze"/><br />
 </circle><br />
 </svg></p>

 NOTES:

 1) The case is preserved which is a Good Thing.

 2) Now HTML paragraph wrappers are placed around each line, which is a Bad
 Thing since now tags are mis-nested (preventing the rendering of the
 circle completely, at least before the circle would render).

 3) If I collapse all the SVG code into one line (no line breaks) then
 WordPress wraps it in a paragraph but otherwise leaves the code alone,
 which is a Good Thing.

 So all in all, if I upgrade my WP installation to 2.7 I shouldn't have as
 much of a problem, but really #2 needs to be fixed.

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


More information about the wp-trac mailing list