]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/MsgIter.pm
msgiter: msg_part_text returns undef on text/html
[public-inbox.git] / lib / PublicInbox / MsgIter.pm
index d9df32abc37c7fc7da68c0e09ed2f942ddbb4827..6453d9f1043630d267d19c8c1445ef8a288f3abe 100644 (file)
@@ -38,6 +38,11 @@ sub msg_iter ($$) {
 sub msg_part_text ($$) {
        my ($part, $ct) = @_;
 
+       # TODO: we may offer a separate sub for people who need to index
+       # HTML-only mail, but the majority of HTML mail is multipart/alternative
+       # with a text part which we don't have to waste cycles decoding
+       return if $ct =~ m!\btext/x?html\b!;
+
        my $s = eval { $part->body_str };
        my $err = $@;