Opened 5 years ago

Last modified 4 years ago

#2007 new bug

translate newlines to <br /> when submitting forum posts in textarea mode

Reported by: lantti Owned by: lantti
Priority: minor Milestone: backlog
Component: BW Forum Keywords: forum newline
Cc:

Description

newlines typed into the forum post textarea print as newlines in the page source when viewing the post. As the format which is used to store the posts is not really defined and the post text is inserted as is into the page I assume the storage format is ready escaped html and translate the newlines to <br /> tags

Change History (8)

comment:1 Changed 5 years ago by lantti

Ok, I assumed wrong, some parts like edit post want the newlines saved as newlines, so the storage format is something mixed. I'll fix this by adding <br />s at the post view instead.

comment:2 Changed 5 years ago by lantti

Ok, that doesn't work either, it messes up the wysiwyg editor posts.

comment:3 Changed 5 years ago by lantti

Ok, I can't figure it out now. Just ignore all the previous comments from me. I'll get me a new head and look into this again.

comment:4 Changed 5 years ago by leoalone

an idea should be the one to automatically convert sequences <LF><LF> into "<br/>" ONLY AT DISPLAY TIME.
not perfect but should work

comment:5 Changed 5 years ago by lantti

While that would work just fine for the text written in the textarea it would break the formatting done by the wysiwyg editor

comment:6 Changed 5 years ago by leoalone

why ? if you use the wysiwyg editor two newline should be coded as "<BR/>\0x0a<BR/>\0x0a" so the \0x0a\0x0a sequence would appear only if you used the pure text editor.

Try it

comment:7 Changed 5 years ago by lantti

@leoalone: Sorry you are right of course. I didn't understand correctly first.

comment:8 Changed 4 years ago by shevek

  • Milestone changed from unassigned to backlog

Adding to backlog.

Note: See TracTickets for help on using tickets.