Stubbisms – Tony’s Weblog

August 10, 2008

WordPress – prevent smileys in code quotes

Filed under: General — Tags: , , , , — Antony Stubbs @ 4:49 am

I finally figured out how to prevent wordpress from replacing some of my source quotes with smiley faces.

WordPress appears to replace all “) with smileys, as after it’s parsed into html, ” get’s converted to &quote; which when a ” appears right before a ) works out to be ") (FYI

" ) - but without the space

) and if you look closely, there’s a little ;) (

; ) - but without the space

) in there!

System.out.println("Hello world!") ;
println "addDependency(['${scope}'], \"${contructSignature(it)}\") {"

So, inserting a space between the ” and the ) stops it from triggering! Hurrah!

System.out.println( "Hello world!" );
println "addDependency(['${scope}'], \"${contructSignature(it)}\" ) {"

However, as you can see, if the ) is immediately followed by a ; then WordPress seems to leave the "); alone…

System.out.println("Hello world!");

I’ve Googled for this before and not found anything, so just thought I’d share the love!

Now to go back and fix some old posts… =D

The Shocking Blue Green Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 686 other followers