Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-706

The class wikigeneratedid is not considered/removed when it is on the figure that surrounds an image

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 14.2
    • Syntax - html/5.0
    • None
    • Unknown

    Description

      Steps to reproduce:

      1. Insert an image without a caption into a document and save and view the document.
      2. Edit the document in the WYSIWYG editor and click the caption option in the image dialog. Save the document again.
      3. 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

          Activity

            People

              Unassigned Unassigned
              MichaelHamann Michael Hamann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: