--- loncom/interface/lonfeedback.pm 2010/01/24 15:30:04 1.285
+++ loncom/interface/lonfeedback.pm 2010/01/24 19:58:24 1.286
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.285 2010/01/24 15:30:04 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.286 2010/01/24 19:58:24 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1396,7 +1396,9 @@ sub get_post_contents {
my ($timesent,$attachmsg);
my %currattach = ();
$timesent = &Apache::lonlocal::locallocaltime($postversions[$i]);
- &newline_to_br(\$messages->{$i});
+ unless (&contains_block_html($messages->{$i})) {
+ &newline_to_br(\$messages->{$i});
+ }
$$messages{$i}=&Apache::lontexconvert::msgtexconverted($$messages{$i});
$$subjects{$i}=~s/\n/\
/g;
$$subjects{$i}=&Apache::lontexconvert::msgtexconverted($$subjects{$i});
@@ -1675,7 +1677,10 @@ END
'bread_crumbs' => $brcrum,});
if ($quote ne '') {
- &newline_to_br(\$quote);
+ $quote = &HTML::Entities::decode($quote);
+ unless (&contains_block_html($quote)) {
+ &newline_to_br(\$quote);
+ }
$quote='
'.&Apache::lontexconvert::msgtexconverted($quote).''; } @@ -2950,16 +2955,17 @@ sub show_preview { } sub contains_block_html { - my ($message)=@_; - return ($message =~ m/ - <(br|h1|h2|h3|h4|h5|h6|p|ol|ul|table|pre|address|blockquote|center|div) - [\s]* - ([\w]+\=['"][\w]+['"])* - [\s]* - ( - [\s]*[\/]>| - >.*<\/\1[\s]*> - )/xs ); + my ($message)=@_; + return ($message =~ m{ + <(br|h1|h2|h3|h4|h5|h6|p|ol|ul|table|pre|address|blockquote|center|div) + \s* + (\w+\=['"]\w+['"])* + \s* + ( + \s*/>| + >.*\1\s*> + )}xs + ); } sub tidy_html {