I have been using the API to update a confluence page with 3 expand sections. It was working perfectly for weeks, then on 4/23/24 it stopped working, throwing the error:
{'statusCode': 400, 'data': {'authorized': True, 'valid': True, 'errors': [], 'successful': True}, 'message': 'com.atlassian.confluence.api.service.exceptions.BadRequestException: Content body cannot be converted to new editor format'}
Through various testing, the error has been localized to using a table in my expand section. This was working until 4/23. The table is a dataframe converted to html. I've tried to convert the dataframe to html in two ways. Example code below:
df3 = pd.read_csv('<filename and path>')table3 = df3.to_html(index=False, escape=False)
also did the following:
def dataframe_to_confluence_table(df):
html = ['<table>']
for i, row in df.iterrows():
html.append('<tr>')
for val in row:
html.append(f'<td>{val}</td>')
html.append('</tr>')
html.append('</table>')
return ''.join(html)
# Convert DataFrame to Confluence-compatible HTML table
table3 = dataframe_to_confluence_table(df3)
And the expand section definition (that used to work, but now fails):
expand_section3 = create_expand_section('Expand to view Data in the last 3d', table3)I'm frustrated since my code was working fine for weeks and now just stopped working. All the other code I have works, including my expand section with non-table text. The table is now not working.
Did something change or anyone have ideas on how to get this working like it was 2 days ago?