How do I remove curly quotes from code examples?

  • Author
    Posts
  • #27247

    veltis
    Member

    If I want to have an example of code on my blog that people can copy, how do I do this? It keeps changing normal quotes to curly quotes, and then the code no longer works when people paste it into their pages. On these forums I can do this:

    <a href="http://www.something.fi">this link</a>

    to keep things as they are, but it doesn’t work on a blog. Any ideas?

    #27376

    cornell
    Member

    It took me a few minutes to figure out, but you can use the HTML character for < and >instead of the character itself. the html to use is & lt;. For example:

    ‘& lt;a href=”http://test.com”& gt;test url& lt;/a& gt;’

    It looks a bit messy, but should work. I hope this displays properly!

    HTH

    Collin

    Edit: It didn’t. You’ll need to take the spaces out of the html codes for them to work.

    #27378

    drmike
    Member

    Change the leading ‘<‘ marks to < That way WordPress won’t pick them up as code. I don’t think you need to do the trailing ones though unless you wan to just to keep in the habit.

    #27380

    drmike
    Member

    Ain’t this fun? :)

    Change the leading ‘<‘ marks to &lt;

    #27404

    cornell
    Member

    Isn’t that generally exactly what I said?

    Ok, so you said it in fewer words (and code…) ;)

    #27405

    timethief
    Member

    *lol* how many times and in how many ways … *lol* here comes the mini full of clowns http://wordpress.com/forums/topic.php?id=932&replies=7

    #27465

    drmike
    Member

    Cornell, yes but when you had it up there beforehand, it didn’t show correctly either. :)

    #28009

    hicamel
    Member

    I thought the question was about curly quotes, not <.

    #28010

    timethief
    Member

The topic ‘How do I remove curly quotes from code examples?’ is closed to new replies.