“Fix” wordpress rendering of “code”

When posting code , wordpress often changes text into gibbersih making code boxes hard to read and copy-paste of code difficult or impossible.

Examples two – show up as — (one).

To fix this, use html code.

Single quote  ‘  = ' yields '

Double quote ” = " yields "

Single dash – = - Yields -

Double dash — = -- yields --

> = > yields >

< = &lt; yields <

The result is “code” that people who follow your blog can copy-paste into their terminals.

Alternately you may use a wordpress plugin. Here is a nice option with links to to other plugins.

This entry was posted in Linux and tagged . Bookmark the permalink.

5 Responses to “Fix” wordpress rendering of “code”

  1. Pingback: Tweets that mention Shadows of epiphany » Blog Archive » “Fix” wordpress rendering of “code” -- Topsy.com

  2. Dylan McCall says:

    Yet another option, if WordPress plugins won’t do it for whatever reason, is a command line tool called GNU source-highlight that’ll format your code with HTML, with syntax highlighting :)

  3. Pingback: Bodhi.Zazen: “Fix” wordpress rendering of “code” | TuxWire

  4. Daniel says:

    I think you rather want to disable this “beautification” inside of WordPress, at least for CODE blocks.

  5. bodhi.zazen says:

    @Daniel – You can do that as well, either by modifying the php code or adding some of the extensions.

    In general, I prefer the “beautification”, so for me, just fix the

Leave a Reply

Your email address will not be published. Required fields are marked *