in reply to Formatting a Textarea field

The problem is likely that the original comment contained both a carriage return and a line break, and when you go to put the comment back in the textarea, both are interpreted as line breaks in your browser.

Just remove all carriage returns from the text before submitting it to the database, and you should be fine.

EDIT: Something like the following, perhaps, though I imagine someone will come up with a better regex.

$text =~ s/(?:\r\n|\n\r)/\n/g;

Replies are listed 'Best First'.
Re^2: Formatting a Textarea field
by bart (Canon) on Jun 05, 2005 at 22:39 UTC
    TedPride's reply is right on the money, IMO, but I'd simply delete the CR (="\r") characters, leaving every actual LF (="\n") characters intact:
    $text =~ tr/\r//d;