When I re-save a post with [code] sections, the entities are double-escaped (> becomes > etc)

I’ve a hard time googling for this issue. On my blog, whenever I update an existing page, code sections are doubly escaped. I.e., on a recent page I have

find /V "QWERTYUIOPPO" < calc.exe:yourads.txt

and after a recent edit it has become:

Read More
find /V &quot;QWERTYUIOPPO&quot; &lt; calc.exe:yourads.txt

When I save it once more, it will escape the entities once more:

find /V &amp;quot;QWERTYUIOPPO&amp;quot; &amp;lt; calc.exe:yourads.txt

Etc. Needless to say this is nasty. For pages containing a lot of code this is a real bummer. Until now I just did some search and replace actions, but this can’t stay forever. Does anybody recognize this issue?

Here’s an example page that illustrates this issue. Also in the screenshot for future reference (as I sure hope to solve the issue on my pages sometime soon).

enter image description here

Related posts

Leave a Reply

1 comment

  1. I face this issue quite often on my own site where I publish code tutorials. Unfortunately, there isn’t a good solution. Instead, I recommend this workflow:

    • Use the WYSIWYG editor to build your article content leaving placeholders for your code snippets.
    • Switch to the HTML editor to add your code snippets

    The visual editor (TinyMCE) tries to escape code-like characters for display. It wasn’t meant for writing code snippets in the first place.