diff --git a/lib/WebGUI/Form/Textarea.pm b/lib/WebGUI/Form/Textarea.pm index 5d250c632..88db88d73 100644 --- a/lib/WebGUI/Form/Textarea.pm +++ b/lib/WebGUI/Form/Textarea.pm @@ -193,8 +193,7 @@ sub toHtml { sub getValueAsHtml { my $self = shift; my $value = $self->SUPER::getValueAsHtml(@_); - $value = WebGUI::HTML::filter($value, 'text'); - $value =~ s/\n/
/sg; + $value = WebGUI::HTML::format($value, 'text'); return $value; } diff --git a/t/Form/Textarea.t b/t/Form/Textarea.t index 6d6399228..1aa97a92b 100644 --- a/t/Form/Textarea.t +++ b/t/Form/Textarea.t @@ -111,7 +111,7 @@ is($session->form->textarea(undef,"some \ntest \r\nhere"), "some \ntest \r\nhere ################################################################### $txt = WebGUI::Form::Textarea->new($session, { value => "line1\nline2\nline3", }); -is($txt->getValueAsHtml, 'line1
line2
line3', 'getValueAsHtml translates newlines into break tags'); +is($txt->getValueAsHtml, "line1
\nline2
\nline3", 'getValueAsHtml translates newlines into break tags'); __END__