Text editor returns values with tags

What are you trying to do?

I want users to be able to read and edit a description of their idea in the same field. The idea is a long, multi-paragraph piece of text.

The text is stored in a supabase.

When using a rich text editor for this purpose I have it add a lot of tags to the entry. The problem is when reading the data back it doesn’t interpret them as tags but rather presents them as text.

What can I do to either prevent it from writing these characters into the DB in the first place or (much better) make it interpret them as HTML and render the text accordingly?

What have you tried so far?

I tried to edit the code in Data Picker using AI assistant to edit out the tags, but as I know precisely 0 javascript, you can imagine, it didn’t work resulting in an error code

Relevant links:

We are working on making this simpler, thanks for reporting!

Hey @sarah_ahmed your reply is a bit cryptic :slight_smile: When you say you are working on making it simpler does this mean there is a work around today that I could use to solve this problem, it’s just not obvious?

You can find a “Use JSON default content” prop on Tiptap rich text editor". If you toggle it on, you should be able to give it the description with tags in “JSON content” prop and it should render the text without tags.

Screenshot 2024-05-01 at 10.32.42 PM

Thank you for the tip, Sarah, but the solution you propose only works as long as I stay on the same page. If I enter the text using the text editor, navigate away to another page of the project and then return, the text is once again full of tags.
Note: I have cleaned all the content for this field in the db using supabase’s own UI to make sure there are no lingering tags at the source

Text right after entry:

Text when I navigate away and then return the very next moment:

As you can see I have implemented the settings you suggested

I have solved the issue by
a) reformatting the target DB column to Jsonb instead of Varchar
b) activating ‘use JSON default content flag’ on the TipTap rich text editor

Hello, apologies for the delay. A fix is on the way for the page switch issue.

Hi @alexander_eliseev, the fix is deployed. The editor should now work after switching page.

1 Like