问题
The source tags inside my video element need to be self closing so the iPad doesn't start whinging.
I type in <source src="myVideo.m4v" />
TinyMCE keeps changing it to <source src="myVideo.m4v" ></source>
though.
How can I tell it to stop?
回答1:
Have a look at valid_elements and extended_valid_elements.
EDIT:
You may use the closed setting in your tinymce init:
closed : /^(br|hr|input|meta|img|link|param|area)$/, // default
to
closed: /^(br|hr|input|meta|img|link|param|area|source)$/,
If this does not work then i think you might additionaly need to change one line of code from the tinymce core code located in Editor.js on line 2666 (newest tiny mce version) and extend the setting there with your source tag.
来源:https://stackoverflow.com/questions/4080132/how-do-i-allow-a-self-closing-tag-in-tinymce