]> git.neil.brown.name Git - edlib.git/commitdiff
doc-email: handle text/rfc822-headers as header
authorNeilBrown <neil@brown.name>
Wed, 11 May 2022 00:40:27 +0000 (10:40 +1000)
committerNeilBrown <neil@brown.name>
Sat, 3 Sep 2022 06:49:08 +0000 (16:49 +1000)
text/rfc822-headers is handled the same as message/rfc822.

Signed-off-by: NeilBrown <neil@brown.name>
doc-email.c

index 6cfacc6e3e9e84c1704cf48e59c64b10a9ee7448..d3468b1438badd973b04c6a00c962ad652a2ac5a 100644 (file)
@@ -687,10 +687,6 @@ static bool handle_content(struct pane *p safe,
                if (minor && minor[0] == '/')
                        minor = get_822_token(&hdr, &mnlen);
        }
-       if (major == NULL ||
-           tok_matches(major, mjlen, "text"))
-               return handle_text(p, type, xfer, disp, start, end,
-                                  mp, spacer, path);
 
        if (tok_matches(major, mjlen, "multipart"))
                return handle_multipart(p, type, start, end, mp, spacer, path);
@@ -698,6 +694,14 @@ static bool handle_content(struct pane *p safe,
        if (tok_matches(major, mjlen, "message") && tok_matches(minor, mnlen, "rfc822"))
                return handle_rfc822(p, start, end, mp, spacer, path);
 
+       if (tok_matches(major, mjlen, "text") && tok_matches(minor, mnlen, "rfc822-headers"))
+               return handle_rfc822(p, start, end, mp, spacer, path);
+
+       if (major == NULL ||
+           tok_matches(major, mjlen, "text"))
+               return handle_text(p, type, xfer, disp, start, end,
+                                  mp, spacer, path);
+
        /* default to plain text until we get a better default */
        return handle_text(p, type, xfer, disp, start, end, mp, spacer, path);
 }