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

Rest API returns LESS code or similar instead of CSS when expanding "styled_view"

    XMLWordPrintable

Details

    Description

      Summary

      Using REST API endpoints like this:
      https://INSTANCENAME.atlassian.net/wiki/rest/api/content/1234567?expand=body.styled_view
      Returns LESS code or other preprocessed CSS code instead of raw CSS.

      Furthermore HTML ID's and Classes are not properly Wrapped into the DOM tree.

      Environment

      Confluence Cloud REST API

      Steps to Reproduce

      1. Log into instance and perform a GET with a URL like this: https://INSTANCENAME.atlassian.net/wiki/rest/api/content/1234567?expand=body.styled_view (be sure to replace the 1234567 with an actual content ID.)
      2. Observe the returned body.

      Expected Results

      Body will be returned with working CSS code.

      Actual Results

      CSS portion of the code looks like this:

      /* wiki-content.css */
      
      /**
      * AUI Overrides
      * see /includes/css/aui-overrides.css
      */
      .rounded-corners (@radius: 5px) {
      -moz-border-radius: @radius;
      -webkit-border-radius: @radius;
      border-radius: @radius;
      }
      
      .wiki-content {
      .header, .footer, .cell {
      

      This contains nested CSS classes which are not a"vanilla" CSS feature.

      Furthermore, you will see code like this:

      .view .wiki-content .cell:first-child,
      .content-preview .wiki-content .cell:first-child {
      padding: 0;
      }
      

      In the above example, the ".view" class was not in the HTML that was returned with the "body.styled_view" however this HTML class was returned in the plain "body.view" expand mode.

      Notes

      N/A

      Workaround

      Current workaround is to process the LESS code in your custom application, or to create your own CSS to style the "body.view" return data.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jlong@atlassian.com Jared Long
              Votes:
              7 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: