Separate data response rich text and plain text

32 views Asked by At

I'm dealing with a Next Typescript project. I'm building a form with formik, slate framework to send a form with rich text to server. The problem is with the old data, it was already stored in database as plain text and the new one will be stored as rich text. So, when I receive all data from server, the errors happen when I try to show the data. I need to separate which is the old data with plain text and which is the new with rich text and then use the approciate method to show the data. Please help me and forgive for my bad english.

I tried to slice the string of the response data. If it contain word like "bold, italic,...." so that was rich text but it won't work.

0

There are 0 answers