Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
14.2
-
None
-
Unknown
-
Description
Steps to reproduce:
- Insert an image without a caption into a document and save and view the document.
- Edit the document in the WYSIWYG editor and click the caption option in the image dialog. Save the document again.
- Edit the document again and switch to source mode (or edit in the "Wiki" editor)
Expected result:
There is no (% class="wikigeneratedid" %) in the source and no id attribute on the image.
Actual result:
There is a (% class="wikigeneratedid" %) in the line above the image and an id attribute on the image.
This is because enabling the caption on an existing image in CKEditor moves the class from the image to the figure. While this may be considered a bug in CKEditor, the problem is that this data is saved in existing documents and we thus need to fix this in a way such that the superfluous attributes are cleaned.
We should thus detect the wikigeneratedid class on figures and treat the class as if it was on the contained image (i.e., remove the class and remove the id on the contained image). Once you are in the described state, the id is no longer updated when you change the image. We should add a check if the id still corresponds to the id that would be automatically generated to avoid that any links or reference to the image are broken by removing the id attribute. If in doubt, I think we should rather keep the id attribute (but still remove the wikigeneratedid class).
Attachments
Issue Links
- relates to
-
XWIKI-20652 Image id is persisted when adding a caption using CKEditor
- Closed