Properly rendering "\n" in tiptap · AI answers shown in tiptap #7057
Unanswered
RicSala
asked this question in
Questions & Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there,
I am using tiptap for my app, where we use the AI sdk from Vercel.
Thing is, the AI answers separate paragraphs with \n
Text that contains line breaks like that show well on the first render (properly adding break lines) but as soon as the user edits the text in the tiptap editor, the line breaks "disappear" and all is shown as one big paragraph.
Right now I am am handling it like this:
which does the trick, but I am not sure how reliable it is, and I guess there must be better ways.
Can you please guide me a bit? I am ok doing my own research, I just wanna avoid reinventing the wheel for what is probably a solved problem (I am pretty sure rendering ai responses in tiptap is quite common and a solved problem!).
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions