I'm looking for a best 开发者_如何学Cpractice approach to achieving a plugin in TinyMCE, to implement insertion of the HTML5 element <figure>
, along one or more child <img>
s, and a <figcaption>
.
Whilst the HTML5 spec seems to allow for other figure types, i.e. other than <img>
, that's all we're concerned with at the moment.
Ideally, the solution would be plugin based and portable.
FYI we're using TinyMCE w/ Django.
You will need to use the extended_valid_elements setting to configure your elements as valid elements and define valid children.
Try this:
http://www.tinymce.com/forum/viewtopic.php?id=29615
It is a small modification of the image plugin so that it uses figure/figcaption when it is the case. It was never used in production, but should work.
精彩评论