Make WordPress Core

Opened 14 years ago

Closed 11 years ago

Last modified 11 years ago

#16448 closed enhancement (fixed)

Smilies should not be placed inside of pre or code tags

Reported by: viper007bond's profile Viper007Bond Owned by: wonderboymusic's profile wonderboymusic
Milestone: 3.8 Priority: normal
Severity: normal Version: 3.1
Component: Formatting Keywords: has-patch needs-testing needs-refresh needs-unit-tests
Focuses: Cc:

Description

Smilies should ignore content inside of <pre> and <code> tags. The author likely is posting code and doesn't need smilies messing it up.

Attachments (1)

16448.diff (1.3 KB) - added by solarissmoke 14 years ago.
Don't mess with smilies in code and pre blocks

Download all attachments as: .zip

Change History (15)

#1 @solarissmoke
14 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

@solarissmoke
14 years ago

Don't mess with smilies in code and pre blocks

#2 follow-up: @Viper007Bond
14 years ago

We'll need to make sure to run any patch through unit tests of course BTW. Gotta make sure it's not significantly slower, etc.

#3 in reply to: ↑ 2 @westi
14 years ago

Replying to Viper007Bond:

We'll need to make sure to run any patch through unit tests of course BTW. Gotta make sure it's not significantly slower, etc.

Indeed, unfortunately we don't have any similes tests yet - http://unit-tests.trac.wordpress.org/browser/wp-testcase/test_includes_formatting.php

Anyone fancy writing some ;)

#4 follow-up: @jakub.tyrcha
13 years ago

See http://gsoc.svn.wordpress.org/2011/jakub.tyrcha for unit tests testing this and a few more things

#5 @jakub.tyrcha
13 years ago

I'm pretty sure it fails on the line containing <code style="color:#fff">

#6 in reply to: ↑ 4 @westi
13 years ago

Replying to jakub.tyrcha:

See http://gsoc.svn.wordpress.org/2011/jakub.tyrcha for unit tests testing this and a few more things

Please could you create a ticket in the unit-tests trac and attach the patch there too.

#7 @c3mdigital
11 years ago

  • Keywords needs-refresh added

#8 @SergeyBiryukov
11 years ago

#23757 was marked as a duplicate.

#11 @mdbitz
11 years ago

Unit Tests and Consolidated Smilies patch can be found in related ticket #20124

#12 @mdbitz
11 years ago

  • Cc matt@… added

#13 @wonderboymusic
11 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 26191:

Don't place smilies inside of pre or code tags. Don't skip smilie after a smilie with an 8 in it. Fix regular expression used for smiley translations to work when there is only one registered emoticon.

Props solarissmoke, soulseekah, mdbitz, yonasy. ht to mdbitz for the Unit Tests and a comprehensive patch.
Fixes #16448, #20124, #25303.

#14 @wonderboymusic
11 years ago

  • Milestone changed from Awaiting Review to 3.8
Note: See TracTickets for help on using tickets.