Opened 6 years ago

Last modified 6 years ago

#11046 confirmed Bug

figcaption moved outside figure tag

Reported by: ttlms Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

In CKEditor 4.2.2 in Chrome, using the following code, ficaption tag is moved outside the figure (and table) tags.

Original code:

 <table class="nolines">
                <tbody>
                        <tr>
                                <td>
                                        <figure>
                                                <img class="borderme shadowme" src="../media/4622/thyroid_intro_thyroidandparathyroid_3_img1of2.jpg" /></figure>
                                        <figcaption>Transverse Imaging Plane</figcaption>
</td>
                                <td>
                                        <figure>
                                                <img class="borderme shadowme" src="../media/4622/thyroid_intro_thyroidandparathyroid_3_img2of2.jpg" /></figure>
                                        <figcaption>Transverse View Thyroid Gland</figcaption>
</td>
                        </tr>
                </tbody>
</table>  }}}

Modified by ckeditor:

<figcaption>Transverse Imaging Plane</figcaption><figcaption>Transverse View Thyroid Gland</figcaption>
<table class="nolines">
        <tbody>
                <tr>
                        <td>
                        <figure><img class="borderme shadowme" src="../media/4622/thyroid_intro_thyroidandparathyroid_3_img1of2.jpg" /></figure>
                        </td>
                        <td>
                        <figure><img class="borderme shadowme" src="../media/4622/thyroid_intro_thyroidandparathyroid_3_img2of2.jpg" /></figure>
                        </td>
                </tr>
        </tbody>
</table>

Also, I noticed figcaption doesn't appear in the status bar as a selectable tag (related?). I am using config.allowedContent = true; as well as config.autoParagraph = false; to supress extra paragraphs, which I think are related to the formatting issue.

Change History (4)

comment:1 Changed 6 years ago by Piotrek Koszuliński

Status: newconfirmed
Version: 4.2.2

It's because your HTML is incorrect. Figcatpion elements are not in figure elements, so CKEditor tries to fix this. It should strip figcaption tags, because they cannot be used in td. Unfortunately it moves them out of table which does not result in correct HTML.

So I'm confirming this, but as a bug in htmlParser. However, it's unlikely that we'll work on it, because it's triggered by incorrect HTML.

comment:2 Changed 6 years ago by ttlms

OK. Thank you for looking at it.

It seems to me in the examples I can find, figcaption does go inside figure tags.

http://www.w3schools.com/tags/tag_figcaption.asp

comment:3 Changed 6 years ago by Piotrek Koszuliński

Yes, exactly. And in your HTML they are not in figure tags. Figure tags end before figcaption start.

comment:4 in reply to:  3 Changed 6 years ago by ttlms

Replying to Reinmar:

Yes, exactly. And in your HTML they are not in figure tags. Figure tags end before figcaption start.

Well I'll be a monkey's uncle.

You are correct, the source is wrong.

I tested corrected source and it doesn't create the issue.

Thanks for your help, I will have editors fix.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy