Hi everyone!,
I can try to import some posts from WP through local API but I have a problem with the content.
I don’t understand how can I convert HTML to RichText using slate.js. Someone could help me?
Hey @stfn7777 checkout the Payload github, they have a ton of good examples of Payload in action alongside Next.
https://github.com/payloadcms/website/tree/main/src/components/RichTextThis is a pretty good example for the RichText Serializer
Ok thank you but this is for "frontend" part, at the moment I try to import posts from WP so I have HTML and I need to transform into the RichText... Is there a way to do that?
It looks like you might be able to use this to do what you are asking:
https://docs.slatejs.org/v/v0.47/other-packages/index
Obviously you will want to test the input/output before running it on all of your data - but I think this would be an excellent starting point.
Ok thank! you I will try it
if you are interested, this serializer works:
https://github.com/thompsonsj/slate-serializersIt works in each convertion html to slate and slate to html
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.