wordpressmarkdownsyntaxhighlighter

How to fix? Wordpress wp-markdown plugin corrupted syntax-highlighter-evolved plugin posts?


I have been documenting some C++ codes (or can be any codes) over the past few months on wordpress, with the Syntax-highlighter-evolved plugin. Everything had worked fine. e.g. the C++ codes displayed correctly in post. e.g. the following syntax would display C++ codes nicely in wordpress.

[code language="cpp"]
   c++ codes goes here...
[/code]

Recently, I have started exploring using mark-down in wordpress and started writing mark-down in new posts with the wp-markdown plugin. (For the benefits of simplicity and ease of migration / sharing / maintenance in long term).

... And then ... I realized all of my older posts (with codes wraped in the Syntax-highligher-evolved syntax) have all got corrupted!

For example, characters (like < > etc), got converted into HTML entities (like &lt; &gt; etc). In addition, I also see LOADS of HTML tags being inserted into the C++ codes.

See here for a sample post on my wordpress site (scroll down to and you will see some code blocks.). It contains some supposingly C++ codes which now looks nothing like C++ codes.

Following discovering this error I have attempted playing around with activating and deactiving the plugins to see if I could get back to the working state (i.e. codes being displayed as C++ codes, instead of hybrid C++/HTML code). No luck so far.

(Currently I have both syntax-highlighter-evoled and wp-markdown plugins activated).

Has anyone encountered similar problems before and how did you resolve this?

Would be very grateful for all the help!

UPDATES (Monday 2nd March 2015):

As a workaround I have (1) disabled the wp-markdown plugin. (2) Kept the syntax-highlighter-evolved activated. (3) Activated the Jetpack markdown plugin. The manual workaround steps below helped me correct 1 (out of about 100) posts.

Update (7th March 2015)


Solution

  • The doggone markdown plugin translates posts from HTML to markdown when it loads them for editing, and translates them back when you Update them. I've had the same problem with code getting trashed. This is a big pain. (I fixed it with a backup.)

    My solution is to use gists -- on http://gist.github.com/ -- to display my code. The oEmbed Gist plugin makes that work very well.