Hi,
We use WordPress with CKEditor for our blog for Developers.
One of the important things is that we are able to add CSharp code to a post.
So we use the 'SyntaxHighlighter Evolved' plugin.
This means that if we want code in our blog, we can add things like the following to the post:
<pre class="code">[csharp]// My CSharp code[/csharp]</pre>
We do this in the Source, because with the rich text editor we cannot add the 'class' to the pre.
But, the following is also C#:
When adding this to the source, and go back to text editor, back to source and back to text editor multiple times, the CKEditor things that <Object> is a begin-tag, and that there should be an end-tag. So it puts somewhere in the text </object> and it turn the uppercase O in object to lowercase.
Is there somewhere an option so CKEditor leaves code like this alone, and does not change this? Is there a special tag to set around the source?
We use WordPress with CKEditor for our blog for Developers.
One of the important things is that we are able to add CSharp code to a post.
So we use the 'SyntaxHighlighter Evolved' plugin.
This means that if we want code in our blog, we can add things like the following to the post:
<pre class="code">[csharp]// My CSharp code[/csharp]</pre>
We do this in the Source, because with the rich text editor we cannot add the 'class' to the pre.
But, the following is also C#:
public IList<Object> GetObject() { }
When adding this to the source, and go back to text editor, back to source and back to text editor multiple times, the CKEditor things that <Object> is a begin-tag, and that there should be an end-tag. So it puts somewhere in the text </object> and it turn the uppercase O in object to lowercase.
Is there somewhere an option so CKEditor leaves code like this alone, and does not change this? Is there a special tag to set around the source?
Re: Leave my source alone
Hi,
please use CKEditor http://docs.cksource.com/ckeditor_api/s ... ctedSource config option . Please add new regex for your C# code.
Remember that protected source is not editable in source mode and is not visible in WYSIWYG mode.
If you use our extension to Wordpress (http://wordpress.org/extend/plugins/ckeditor-for-wordpress/), please check ckeditor.config.js file in ckeditor-for-wordpress directory or "File editor" tab in CKEditors settings in Wordpress admin panel.