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

Advertisements

7 Comments »

  1. There is actually an easier way to do this. From your dashboard, just go to Settings, then click on the “Writing” tab and you’ll see a box for:

    Convert emoticons like : ) and : P to graphics on display

    Uncheck that and you’ll free from emoticons! Hopefully this helps.

    Douglas
    WordPress.com Support

    Comment by Douglas — August 11, 2008 @ 3:39 pm

  2. Ah yes, but the problem with that is that your emoticons are not converted into graphics 😉

    Comment by Antony Stubbs — August 11, 2008 @ 4:09 pm

  3. You can use the ascii codes instead of the characters. so for ) would be )

    Comment by Mathew — August 13, 2008 @ 12:24 am

  4. FYI that’s & # 4 1 ; without the spaces 😉

    Comment by Antony Stubbs — August 20, 2008 @ 1:51 am

  5. I used the ascii codes but now it displays &#58 instead of “:”

    Any ideas on how to actually get around this.

    Mind you I’m trying to post a javascript sourcecode between the [ sourcecode language=”javascrip”][ /sourcecode] tags and the “:o” get’s converted to 😮

    Comment by horgasz — January 23, 2009 @ 3:32 am

  6. 😮
    

    Comment by horgasz — January 23, 2009 @ 3:33 am

  7. […] nu vreau “emoticons” ? … folosesc tehnici “spațiale” văzute aici sau când spațiile mă copleșesc (sunt puțin agorafob) folosesc codul ASCII :  “& […]

    Pingback by EMOTI(I) COANE … în Wordpress « Chat Noir — September 12, 2009 @ 7:15 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: