Legacy pages with nested span elements do not convert to the new editor

XMLWordPrintable

    • 12
    • Minor
    • 5

      Issue Summary

      Legacy pages or templates with nested span elements, specifically text color and background color can be converted to the new editor, even though these elements are not supported. Converting pages with these elements will result in a broken page.

      This issue was observed also on texts where there are no nested spans, but has the text and background color on the same span.

      Steps to Reproduce

      1. Create a legacy page with the following storage format:
        • <p>
              <span style="color: rgb(112,112,112);">
                  <span style="background-color: rgb(245,245,245);">
                      <em>Emphasized text</em>
                  </span>
              </span>
          </p> 

            2. Attempt to convert the page to the new editor

      Other reproducible scenarios:

      1. Create a page using the current editor
      2. Try to add the background color by highlighting the text you want
      3. Try adding the text color after the background color was added
      4. Create a page using the Confluence REST API (v1 and v2)
      5. Add a span tag to add the color to the background and the text color
        For example:
      <p>
      	<span style="color: blue;background-color: yellow;">Styled text</span>
      </p>
      

      Third scenario:

      1. Create a page using the legacy editor
      2. Try to add the background color by highlighting the text you want
      3. Try adding the text color after the background color was added
      4. Create a page using the Confluence REST API (v1 and v2)
      5. Add a span tag to add the color to the background and the text color
      6. Convert the page to the current editor

      Expected Results

      The user should either be prompted with a message indicating that this page is not eligible to be converted to the new editor, or support is added for these elements.

      Actual Results

      The page goes blank in edit mode and all content is gone.
      In some cases the user is still able to convert, resulting in a broken page due to this error:

      RangeError: Invalid collection of marks for node text: em,textColor,backgroundColor

      Workaround

      Remove the nested span elements with text color/background color before converting the page.

            Assignee:
            Selena Sui
            Reporter:
            Josh Ramos
            Votes:
            2 Vote for this issue
            Watchers:
            22 Start watching this issue

              Created:
              Updated:
              Resolved: