简体   繁体   中英

How do I allow a self closing tag in TinyMCE?

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM