Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-69250

Converting content to styled_view using REST API returns invalid css

    XMLWordPrintable

Details

    Description

      Issue Summary

      When converting contents to styled_view using the REST API (/rest/api/contentbody/convert/styled_view), it returns the content with some css styles applied. But this CSS styles contain a few problems that prevents styling the whole content properly.

      Steps to Reproduce

      1. Call the REST API and passing in some body in some content format (i.e., storage format)
      2. Validate the returned value

      Expected Results

      The API returning a proper valid CSS so that the content is styled properly

      Actual Results

      The CSS returned with the styled content is invalid. Based on my observation, the following issues can be found:

      • The CSS are batched together, but single line comments (i.e., // comments) are not removed, so there are parts of the css where it's invalid. The whole minified CSS is a single line, so everything after the single line comment is commented out.
      • Some styles are being returned in LESS format instead of regular CSS. (https://jira.atlassian.com/browse/CONFCLOUD-57168)

      Workaround

      Manually getting the CSS and using that instead of the generated CSS in the styled view response.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rtalusan Ryan Talusan
              Votes:
              7 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated: