From 74e60b1ef10fbc09ed5103c3d945acbddc9e365e Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 28 Sep 2008 08:40:35 -0300 Subject: [PATCH] pass text/html parts though --- IkiWiki/Plugin/mailbox.pm | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/IkiWiki/Plugin/mailbox.pm b/IkiWiki/Plugin/mailbox.pm index 92ddf99f3..039512c0c 100644 --- a/IkiWiki/Plugin/mailbox.pm +++ b/IkiWiki/Plugin/mailbox.pm @@ -196,10 +196,12 @@ sub format_message(@){ $_->content_type_set('text/plain'); $_->body_set("[ omitting part $partcount: $allowed ]"); - } + } + $partcount++; } - my $body= join("\n", map { $_->body } @parts); + my $body= join("\n", map { format_part($_->content_type, $_->body) } + @parts); $template->param(body=>format_body($body)); @@ -207,13 +209,27 @@ sub format_message(@){ return $output; } +sub format_part($$){ + my $mime_type=shift; + my $body=shift; + + my $rval=""; + + # for debugging: + $rval .= "[ $mime_type ]\n"; + + if ($mime_type =~ "^text/html"){ + $rval.= $body; + } else { + $rval .= "
".escapeHTML($body)."
"; + } + return $rval; +} sub format_body($){ my $body=shift; - # it is not completely clear to me the right way to go here. - # passing things straight to markdown is not working all that - # well. - return "
".escapeHTML($body)."
"; + return $body; + } ### Utilities -- 2.26.2