Support » Plugin: Advanced Editor Tools (previously TinyMCE Advanced) » TinyMCE adds before a element that’s within a caption

  • When using a <div> element in an image caption, TinyMCE adds <br /> elements just before the <div> tag every time I switch from visual to text mode. For example if I have an image with the following:

    [caption id="attachment_10084" align="alignright" width="236"]text Caption text<div class=”photocredit”>Photo credited here</div>
    [/caption]

    Switching from visual to text editing once gets me:

    [caption id="attachment_10084" align="alignright" width="236"]text Caption text <br />
    <div class=”photocredit”>Photo credited here</div>
    <br />[/caption]

    Going from text to visual and back to text gets me:

    [caption id="attachment_10084" align="alignright" width="236"]text Caption text <br />
    <br />
    <div class=”photocredit”>Photo credited here</div>
    <br />[/caption]

    And so on — the <br /> tags keep stacking up. The <br /> elements only stack up prior to the <div> element, not after the </div>.

    The <div> element seems to be the only case of this happening. I played with an tag, and that did not have the same problem.

Viewing 1 replies (of 1 total)
  • Plugin Author Andrew Ozz

    (@azaozz)

    This is a limitation in core’s implementation. Image captions don’t support “block” tags as they usually break the displaying of the caption. Perhaps try using “inline” element like span or something more semantic.

Viewing 1 replies (of 1 total)
  • The topic ‘TinyMCE adds before a element that’s within a caption’ is closed to new replies.