Image output when using scald module I'm using the scald module for image management.
It's working 99% as I'd want it to - but when used with WYSIWYG (ckeditor) I'm having an annoying issue.

The images in this context need captions so I've hooked into the scald templating and changed the output to use  and  tags.

All fine - except when saved the WYSIWYG / scald seem to add lots of empty  tags between the figure and the figcaption.

Attempting to use the empty paragraph tag module or create my own input filter have failed as they run before scald replaces the atom reference with the actual image output. 

Any suggestions on where to hook into scald to be able to influence this markup?
I've been able to resolve this without using Scald templating.

The Scald plugin for CKeditor automatically inserts the image Title as the caption just below the image.  This text is editable in WYSIWYG if you want to replace the image Title with your own caption.

Below is how it looks at my site. Notice the caption just below the image.  (This is without any additional CSS - it can look nicer if you add some some CSS.)



And this is the markup inserted by the Scald plugin.  The caption is in the &lt;div&gt; with the class dnd-legend-wrapper: 

&lt;div class="dnd-atom-wrapper type-image context-sdl_editor_representation atom-align-right" contenteditable="false"&gt;
&lt;div class="dnd-drop-wrapper"&gt;&lt;!-- scald=2:sdl_editor_representation {"link":""} --&gt;
&lt;div class="image"&gt;&lt;img alt="Fred Espen Benth" src="http://example.com/sites/default/files/styles/large/public/thumbnails/image/fredespenbenth.jpg?itok=TwJhh_s6" style="height:320px; width:480px" title="Fred Espen Benth" /&gt;&lt;/div&gt;
&lt;!-- END scald=2 --&gt;&lt;/div&gt;

&lt;div class="dnd-legend-wrapper" contenteditable="true"&gt;
&lt;div class="meta"&gt;&lt;!--copyright=2--&gt;Fred Espen Benth. Foto: Gunhild M. Haugnes&lt;!--END copyright=2--&gt;.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;