views:

81

answers:

2

Hi,

I found some threads regarding this issue on SO, but so far nothing mentioned there helped me. I want to display C# and XAML Code in Wordpress.

I, unsuccessfully, tried using the following plugins:

  • Google Syntax Highlighter for WordPress
  • WP-Syntax
  • Code Auto Escape

When writing a new article, I go to the "HTML-View" where I tried every combination of the code- and pre-tag, but every time when I return to the "Visual-View", all HTML/XML/XAML Code-Tags are gone. C# Code is rendered in the correct Code-Font, but not highlighted at all.

Could it be that those plugins are only compatible to the english edition of wordpress (I use the german version)?

What else could I be doing wrong?

Thanks, Andrej

A: 

The author of Google Syntax Highligher Plugin says he's fixed it so it works with visual mode.

songdogtech
I fixed the pre-tag issue, but still neither are languages highlighted, nor is any kind of XML/HTML shown. E.g. the following code simply disappears after going into visual mode:<pre class="xml" title="code”><someTest someAttribute="0"><someInnerElement /></someTest></pre>
Andrej
Do you have white space in the code snip? WP adds paragraph and break tags in visual mode. Check your rendered page source and see what WP is spitting out in terms of html.
songdogtech
+1  A: 

I use "SyntaxHighlighter Evolved". And as a precaution put all the code (including the tags required for the plugin) within <pre> tags.

Littlejon
Thanks, this Plugin seems to work perfectly.
Andrej