Opened 11 years ago
Last modified 11 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 11 years ago by
Status: | new → confirmed |
---|---|
Version: | 4.2.2 |
comment:2 Changed 11 years ago by
OK. Thank you for looking at it.
It seems to me in the examples I can find, figcaption does go inside figure tags.
comment:3 follow-up: 4 Changed 11 years ago by
Yes, exactly. And in your HTML they are not in figure tags. Figure tags end before figcaption start.
comment:4 Changed 11 years ago by
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.
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.