--- loncom/interface/lonfeedback.pm 2009/12/22 06:14:35 1.283
+++ 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.283 2009/12/22 06:14:35 faziophi Exp $
+# $Id: lonfeedback.pm,v 1.286 2010/01/24 19:58:24 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -403,8 +403,7 @@ sub list_discussion {
my $manifestfilename = $tempexport.$manifest;
if ($manifestfile = Apache::File->new('>'.$manifestfilename)) {
$manifestok=1;
- print $manifestfile qq|
-
+ print $manifestfile qq|
/g;
$$subjects{$i}=&Apache::lontexconvert::msgtexconverted($$subjects{$i});
@@ -1411,7 +1412,7 @@ sub get_post_contents {
foreach my $key (sort(keys(%currattach))) {
if ($$allattachments{$key}{'filename'} =~ m-^/uploaded/([^/]+/[^/]+)(/feedback)?(/?\d*)/([^/]+)$-) {
my $fname = $1.$3.'/'.$4;
- $$imsfiles{$idx}{$i} .= '
';
}
}
@@ -1676,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).'
';
}
@@ -1710,7 +1714,6 @@ $lt{'title'}: $comment
END
if ( ($env{'form.editdisc'}) || ($env{'form.replydisc'}) ) {
if ($env{'form.origpage'}) {
@@ -1732,6 +1735,7 @@ END
}
} else {
$r->print(<
'.&Apache::lonhtmlcommon::coursepreflink(&mt('Discussion Settings'),'discussion').'
' .$discussoptions; } @@ -2951,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 {