I use TinyMCE 4 as a WYSIWYG editor for HTML pages. But when I use FreeMarker tag idioms like <#if condition>
, <#else>
in TinyMCE, they get mangled when I go from "code view" (simple textarea) to the "design view" (WYSIWYG).
For example if I write HTML in a simple textarea (Code view)
<#if x == 1>
x is 1
<#else>
x is not 1
</#if>
and then toggle to editor and back to Code view, it becomes:
<#if x == 1>
x is 1
<#else/>
x is not 1
</#if>
As you can see FreeMarker tags are getting escaped in the toggling.
Q1: Is there a way to configure TinyMCE to handle these tags so that when I toggle back-and-forth between the editor and the Code view the markup remains consistent?
Q2: Or (saying the same thing in a different way) does TinyMCE have support for FreeMarker?
What have I tried so far?
- I've used the alternative (square bracket) syntax.
But I've encountered different problems since[#tag]...[/#tag]
is treated as plain text by TinyMCE. I've tried to disable HTML validation in configuration:
verify_html: false, valid_elements: '*[*]',