This configuration option enables you to control what contents should be protected from editing while it gets passed into the editor. This could for example be control codes in the HTML. It's recommended not to use inline control contents since it breaks the wisiwyg editing concept but sometimes they can't be avoided.
The option takes an array of regexps that it will match the contents against and these will be invisible while editing.
Example of usage:
tinymce.init({
protect: [
/\<\/?(if|endif)\>/g, // Protect <if> & </endif>
/\<xsl\:[^>]+\>/g, // Protect <xsl:...>
/<\?php.*?\?>/g // Protect php code
]
});
Was this article helpful? Yes - No
Well, that's awkward . Would you mind opening an issue or helping us out?
Thanks for the feedback!
Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.