I'm trying to allow some custom tags to be entered into TinyMCE. The tag is
<plug:plugin_name />
However this is turned into
<plug:plugin_name></plug:plugin_name>
I'm about to write a regex to deal with this as I have to get the job done, I'd really rather not, but it will fix my issue.
I've tried many of the init options:
extended_valid_elements : "plug.plugin_name[*]",
custom_elements: "plug.plugin_name[*]",
verify_html : false, **//This ment that the tag wasn't ouright removed**
selfclosetags : \" />\", //some plugin I found, didn't seem to work
closed : /^(br|hr|input|meta|img|link|param|area|plug:plugin_name)$/,
Anyone else definitely got this to work with a recent version of TinyMCE?
Also, another problem will be the editor will strip away the tag, after I have fixed it with the regex!
You just need to add it to the list of short ended elements:
extended_valid_elements : "plug:plugin_name[*]",
custom_elements: "~plug:plugin_name[*]",
short_ended_elements: 'area base basefont br col frame hr img input isindex link meta param embed source wbr track plug:plugin_name'
Here's a fiddle to demonstrate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With