Get rid of WordPress messing with your quotes while writing code
May 1, 2008 – 10:45 pmby Jake D
Problem: Recently I was writing an article where I posted some python code. Using WordPress, I was switching between HTML/Code view and “Visual” view. Every time that I switched, the WordPress editor would change some of my code, namely the quotes. I ended up with something that looked like this:
Solution: Not exactly sure, but it seems to have stopped.
There are several WordPress posts that go over an issue of using the
[/sourcecode] tag to write sourcecode. Personally, I was very frustrated because while writing in Python, where whitespace matters, my indents would all be lost when switching between the visual and HTML editor in WordPress. My solution was to wrap my [sourcecode]
tags in <pre> tags.
Check the plugin?
I originally was using the
[/sourcecode] tag from <a href="http://code.google.com/p/syntaxhighlighter/">SyntaxHighlighter</a>, then found another one, called SyntaxHilighter Plus. I don't have time to go over all of this, but I disabled the Plus version, re-enabled the regular SyntaxHighlighter, and made sure to wrap my [sourcecode]
s in <pre> tags.



