preparing for 6.2.4 bugfix cycle
This commit is contained in:
parent
eeecbe8afb
commit
ce9cfe43a2
4 changed files with 18 additions and 12 deletions
|
|
@ -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/ /g;
|
||||
$content =~ s/\n/\<br \/\>/g;
|
||||
} elsif ($contentType eq "code") {
|
||||
if ($contentType eq "text" || $contentType eq "code") {
|
||||
$content =~ s/&/&/g;
|
||||
$content =~ s/\</</g;
|
||||
$content =~ s/\>/>/g;
|
||||
$content =~ s/\n/\<br \/\>/g;
|
||||
$content =~ s/\t/ /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/ / /g;
|
||||
} elsif ($contentType eq "code") {
|
||||
$content =~ s/ / /g;
|
||||
$content = '<div style="font-family: monospace;">'.$content.'</div>';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue