I integrated the ckeditor WYSIWYG base on the help from 'http://ckeditor.com/demo#full' and it is working fine.
But When I use freemarker tag idioms like <#if condition>, <#else> in ckeditor, they get mangled when I go from "design view" (ckeditor WYSIWYG) to the "source view" (simple textarea) and then back again.
For example if i write HTML in a simple textarea
<#if x == 1>
x is 1
<#else>
x is not 1
</#if>
and then toggle to ckeditor, it becomes:
<#if x == 1>x is 1<#else>x is not 1
And then when i toggle back to a simple textarea it changes to
<#if x == 1>
x is 1
<#else/>
x is not 1
<!--#if-->
The freemarker tags are getting escaped in the toggling.
Is there a way to configure ckeditor to handle these idioms so that when I toggle back-and-forth between ckeditor and a simple textarea that the markup remains consistent?
Or, saying the same thing in a different way-- does ckeditor have built-in support for handling Freemarker or Velocity tags?

CKEditor abides by W3C
CKEditor abides by W3C standards, so it changes code accordingly. It also has a feature called ACF (Advanced Content Filter), and a it modifies script for security reasons, which you can preserve. Check these links out:
Advanced Content Filter
ProtectedSource
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
Thanks Sebastian Stefanov for
Thanks Sebastian Stefanov for looking in this.
I checked the Advanced Content Filter but these filters only support those tags whose are defined as <a></a> and freemarker tags are defined as <#if></#if>.
I also checked the Protected Source and this is near to my requirement. But I also want to show the freemarker tag in editior without formatted
Is there any way to show the protected source code in editior whithout formatted?
Any help and suggestions are greatly appreciated.
I did some research on this and found that whenever CK-editir encounter any tag which start from '</special_character' then CK-editor is treating this tag as a comment (CKEDITOR.NODE_COMMENT) and generating the HTML comment tag in output.
But I do not find any regular expression/logic in 'ckeditor.js' file which is determining this behavior. I think if we are able to change that regular expression/logic then this issue will be resolved automatically.
Has any one idea about this regular expression/logic?
I am also getting the some unexpected behaviour in CK-Editor.
If i write HTML in ckeditor
<#if x == 1>
x is 1
<#else>
x is not 1
</#if>
and then toggle to source code, it becomes:
<#if x == 1>
x is 1
<#else/>
x is not 1
</#if>
This conversion will work for me. But when I save this content and come back to edit then this again changes to
<#if x == 1>
x is 1
<#else/>
x is not 1
<!--#if-->