PerfectlyNormal / tinymce-rails-imageupload

Image upload plugin for TinyMCE and Rails with the asset pipeline
MIT License
149 stars 154 forks source link

Allowing to wrap <img> in <figure> #63

Closed alexJunger closed 9 years ago

alexJunger commented 9 years ago

I found it useful to allow wrapping the img in a figure tag and add a figcaption, based on the description you enter in the popup - makes a little better use of it than just putting it in the alt attribute imo. In the init call, add uploadimage_figure: true to create this structure:

<figure class='figure'>
  <img src='..' alt='whatever'>
  <figcaption class='figcaption'>whatever</figcaption>
</figure>

You can also pass other classes with uploadimage_figure_class and uploadimage_figcaption_class

PerfectlyNormal commented 9 years ago

Thanks!