Using REST API endpoints like this:
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.
Confluence Cloud REST API
- 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.)
- Observe the returned body.
Body will be returned with working CSS code.
CSS portion of the code looks like this:
This contains nested CSS classes which are not a"vanilla" CSS feature.
Furthermore, you will see code like this:
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.
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.