Is there a function to translate HTML to Ricos format?

Hi everyone

I’m really struggling on implementing Wix blog post export from my app. Indeed, my software is a FastAPI - ReactJS project and I want to export blog posts with FastAPI.

The only problem is that my content is in HTML while Wix asks for a weird “Ricos” language, which is indeed a custom JSON format. And I don’t find any proper way to translate it.

I’ve tried to use https://ricos.js.org/ however it seems to be really buggy and outdated as it seems to be created for JS backends and seems to only work with older react versions. Indeed, I’ve tried to npm install ricos-content and tried to do this :

import { fromRichTextHtml } from 'ricos-content/libs/server-side-converters';
const content = fromRichTextHtml(myHTMLContent);

But I get a lot of file imports problems and it just does not work.

So does someone know if ever there is a good solution ? Maybe a translator in python ? Cause otherwise it means that I’ll have to implement it myself (so really time expensive) and I can’t imagine no one ever faced this issue.

Thanks in advance for your help ! :wink:

Wix’s blog content uses Ricos JSON format, and converting HTML to Ricos can be tricky since existing tools like ricos-content are outdated and buggy. Since there’s no official Python converter, the best approach is to use a JavaScript microservice within your FastAPI backend. Deploy a simple Node.js function with ricos-content to handle the conversion and call it via API from FastAPI. If that’s not an option, you might need to manually map HTML elements to Ricos JSON structure. Let me know if you need help setting up the microservice.