preparing for 6.2.4 bugfix cycle

This commit is contained in:
JT Smith 2004-09-16 21:11:12 +00:00
parent eeecbe8afb
commit ce9cfe43a2
4 changed files with 18 additions and 12 deletions

View file

@ -156,19 +156,20 @@ The content type to use as formatting. Valid types are 'html', 'text', 'code', a
sub format {
my ($content, $contentType) = @_;
$contentType = 'mixed' unless ($contentType);
if ($contentType eq "mixed") {
unless ($content =~ /\<div/ig || $content =~ /\<br/ig || $content =~ /\<p/ig) {
$content =~ s/\n/\<br \/\>/g;
}
} elsif ($contentType eq "text") {
$content =~ s/\t/&nbsp;&nbsp;&nbsp;&nbsp;/g;
$content =~ s/\n/\<br \/\>/g;
} elsif ($contentType eq "code") {
if ($contentType eq "text" || $contentType eq "code") {
$content =~ s/&/&amp;/g;
$content =~ s/\</&lt;/g;
$content =~ s/\>/&gt;/g;
$content =~ s/\n/\<br \/\>/g;
$content =~ s/\t/&nbsp;&nbsp;&nbsp;&nbsp;/g;
}
if ($contentType eq "mixed") {
unless ($content =~ /\<div/ig || $content =~ /\<br/ig || $content =~ /\<p/ig) {
$content =~ s/\n/\<br \/\>/g;
}
} elsif ($contentType eq "text") {
$content =~ s/ / &nbsp;/g;
} elsif ($contentType eq "code") {
$content =~ s/ /&nbsp;/g;
$content = '<div style="font-family: monospace;">'.$content.'</div>';
}