+
+ if ($content_obj->ContentType =~ m{^text/html$}i) {
+ $content =~ s/<p>--\s+<br \/>.*?$//s if $args{'Quote'};
+
+ if ($args{Type} ne 'text/html') {
+ $content = HTML::FormatText->new(
+ leftmargin => 0,
+ rightmargin => 78,
+ )->format(
+ HTML::TreeBuilder->new_from_content( $content )
+ );
+ }
+ }
+ else {
+ $content =~ s/\n-- \n.*?$//s if $args{'Quote'};
+
+ if ($args{Type} eq 'text/html') {
+ # Extremely simple text->html converter
+ $content =~ s/&/&/g;
+ $content =~ s/</</g;
+ $content =~ s/>/>/g;
+ $content = "<pre>$content</pre>";
+ }
+ }