Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

TinyMCE 2 Prevent Code Rewirtes

$
0
0

I'm having a probelem with the TinyMCE editor rewriting code when I go to the code view, and it is breaking things.

For example I'm trying to add a span tag inside an a tag for a font awesome icon.

I have this 

<a class="btn btn-primary"><span class="fa fa-search">&nbsp;</span></a>

But when I add an ID to the a class it rewrites the HTML to this

<a id="test" class="btn btn-primary"></a><span class="fa fa-search">&nbsp;</span>

There is absolutly no reason for it to re-write this code.  So I need a way to prevent TinyMCE to prevent code rewrites

The ony thing I have discoved in the TinyMCE documentation was a "Verify HTML" for version 3.  But since EPi now uses version 4, this seems to no longer work.  I've added these settings in my TinyMCE config, and I can't get it to stop rewriting html from the code view.

.AddSetting("verify_html ", "false")
.AddSetting("cleanup", "false")

 

Any Suggestions?  


Viewing all articles
Browse latest Browse all 9076

Trending Articles