How to have proper paragraphing for rich text editor to edit open AI output?

I have content from open AI that displays fine when I display the data on an input form.

However, when I try to pass the same data to the “rich text editor” so that I can edit the output, all the paragraping is lost. How do I make sure the paragraphing happens properly?

2 Likes

I’m running into the same issue with a slightly different use case. Bringing in markdown from my database that I want to edit using the rich text editor. Like you, I lose all paragraphing, which then of course effects the markdown formatting when I write it back to my DB.

@Joyce have any pointers you can share here? Thanks!

Use a gpt function call to properly format/coerce your data?! It’d allow you to return the text in a predictable format that you can expect and thus use in any environment, most of the time

Has anyone been able to solve this yet?

This is really the only thing keeping me from building my app on WeWeb. We shouldn’t have to use GPT functions just to get simple formatting. GPT will return a completion properly, if there’s an issue displaying it only in a rich text input vs another element, that means the issue lies with WeWeb’s Rich Text element.

I’ve used multiple other No-Code and lowcode tools, they all handle this correctly without complicating things with Functions lol.

Hi @raelyn, you can open a bug ticket on support.weweb.io so we can allow time to improve the behavior :slight_smile:

As a workaround, I think you need to apply the replace formula on the open ai result, to replace every \n occurence by <br> because it expect HTML for line breaks.

It works in my test project


1 Like

Sorry, markdown is not a supported format. You will need a custom rich text component. You can make a feature request on feedback.weweb.io so we can priorise it. :slight_smile:

1 Like

Hello,
@Alexis, has a solution been implemented? I am also looking for a solution to allow users to edit OpenAI-generated texts :slight_smile:

Vivien

Almost! Its in QA. It should be released in the next two weeks. You will be able to toggle the output format and choose markdown instead html. The input format will be free, both will work.

A new image support will be added too.

1 Like

Awesome, can’t wait to see it :pray:

Amazing!!! Will it have the ability to change text alignment too? Thank you :smiling_face:

It was not planned but I will add it as available component actions :slight_smile:

1 Like

thank you!

Hey Alexis!! Is this out yet? Can’t wait!

Image has been released as a component action, text align and markdown support should be released tomorrow :slight_smile:

2 Likes

I was wrong, it was released last week already @raelyn, you can find a new component action to trigger alignment too :slight_smile:

1 Like

Oh! But is markdown supported already? How can I tell if it is? Haha…

By typing markdown inside ? :sweat_smile:

You also have a new option to choose the output format, if you prefer to export markdown in the component variable and in the on change event value.

Oh yes! I see it <3

1 Like