Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Converting from Storage XHTML to ADF in javascript on Confluence Server

Sam Sloate
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 28, 2023

This is a question specific to Confluence Server that does not apply to Confluence Cloud.

I am using the rest API to retrieve page content. This is returned in a variety of HTML formats. As far as I am aware there is no ability to retrieve the page body as ADF when on Confluence Server. Ultimately my goal is to get the page content as ADF.

Given the limitations of the API is there a supported JS library for converting from the storage (or other html formats returned from the API) to ADF?

I have attempted to use the following libraries although I could be misusing them as I have not been able to find official documentation.

@atlaskit/adf-schema/schema-default
@atlaskit/editor-json-transformer
prose-mirror

Using these libraries the conversion seems to be relatively lossy with things like page format not being maintained. Ideally would like to use an officially supported library for this purpose such that I can get better fidelity. I am okay losing some macro details but ideally everything else is preserved on conversion.

Thanks!

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events