0

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

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

2 Comments

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>
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.