print "<br/>",$self->summary(),"\n";
print "<br/><br/>\n";
foreach $line ( split /\r?\n/s,$self->message() ) {
- print "<br/>",$line,"\n";
+ print "<br/>",wml_escape($line),"\n";
if ( ++$cnt >= 15 ) { last; }
}
}
print "<hr>\n";
}
+# Escape non-standard HTML characters
sub escape {
my($toencode) = @_;
$toencode=~s/([^ a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;
return $toencode;
}
+# Escape non-standard WML characters
+sub wml_escape {
+ my($toencode) = @_;
+ $toencode =~ s/&/&/g;
+ $toencode =~ s/</</g;
+ $toencode =~ s/>/>/g;
+ $toencode =~ s/\"/"/g;
+ $toencode =~ s/\'/'/g;
+ $toencode =~ s/\?\?/­/g;
+ return $toencode;
+}
sub format_duration {
my($self,$stime,$rtime) = @_;