[wp-trac] [WordPress Trac] #44278: Smileys got rendered inside pre/code tags in case html attributes are added to the tag

WordPress Trac noreply at wordpress.org
Wed May 30 14:22:32 UTC 2018


#44278: Smileys got rendered inside pre/code tags in case html attributes are added
to the tag
---------------------------+------------------------------------
 Reporter:  Andi Dittrich  |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Formatting     |    Version:  trunk
 Severity:  normal         |   Keywords:  has-patch dev-feedback
  Focuses:                 |
---------------------------+------------------------------------
 hi!

 in case "raw" content is posted in a pre tag, legacy smiley sequences are
 processed by the convert_smilies function and converted to images, even if
 the html tags are in the **$tags_to_ignore** list.

 this is caused by a weak regex inside the function which didn't take care
 of html attributes

 **current behaviour**
 [[Image(https://media.andidittrich.de/wp-trac/current.png)]]

 **expected behaviour**
 [[Image(https://media.andidittrich.de/wp-trac/expected.png)]]

 **example content to reproduce the issue**

 {{{
 hello :)

 this is sourcecode and should not contain smiley images:
 <pre class="EnlighterJSRAW" data-enlighter-language="js">alert(':)');
 // :)</pre>
 and text :(
 }}}


 attached a fixed version which is taking care of additional html
 attributes

 best regards, Andi

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


More information about the wp-trac mailing list