Open-Assistant icon indicating copy to clipboard operation
Open-Assistant copied to clipboard

Double newlines get deleted after sending the answer

Open tellmewhy12 opened this issue 2 years ago • 4 comments

Double new lines like

this one above, would be deleted in an answer. I'm not sure if it's a bug but I've wanted to use it to separate paragraphs / make maths more readable.

tellmewhy12 avatar Feb 17 '23 19:02 tellmewhy12

The answers are in markdown, just like on here. So I guess you'll need to do:

Something like this
<br>
for it to work

i.e.:

Something like this
for it to work

Though inserting HTML into answers might cause other issues, there's a very limited subset that are safe, and it'll probably come out encoded instead.

bitplane avatar Feb 19 '23 01:02 bitplane

Looks like it's a rendering issue:

  • Double newlines are saved to the DB, they just don't make it into the HTML after being passed through Markdown.
  • <br> doesn't get mangled, but it doesn't get rendered either:

image

image

{"text":"This is the prompt\n\n<br>\n\nThis comes after it"}

I'm thinking that if we're doing markdown, then we should probably support inline <br> tags and allow that.

bitplane avatar Feb 19 '23 05:02 bitplane

This is just a matter of actually showing the newlines in the UI I think. They are definitely present in the DB

olliestanley avatar Feb 20 '23 22:02 olliestanley

I think this was fixed in #1746.

GuilleHoardings avatar Feb 27 '23 22:02 GuilleHoardings