summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-11-29 18:19:14 -0500
committerJune McEnroe <june@causal.agency>2020-11-29 18:19:14 -0500
commitdff54eaeea5cdd7e5a16ad279e8691225d6b15c2 (patch)
tree10d84a760342fd4c5ddb15132ff85e70a8ddc520
parentFix section spec of multipart/alternative fallback export (diff)
downloadbubger-dff54eaeea5cdd7e5a16ad279e8691225d6b15c2.tar.gz
bubger-dff54eaeea5cdd7e5a16ad279e8691225d6b15c2.zip
Fall back to multipart export for alternative without suitable inline
1. Otherwise a single part exported as an attachment will generate a
   <li> without surrounding attachment <ul>.
2. This renders mimedown[1] messages more pleasingly, rather than just
   choosing the HTML part.

[1]: https://github.com/begriffs/mimedown
-rw-r--r--export.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/export.c b/export.c
index f060c0b..d195104 100644
--- a/export.c
+++ b/export.c
@@ -231,17 +231,9 @@ static int exportHTMLBody(
 				&part->parts.ptr[i], dataCheck(body, List).list.ptr[i]
 			);
 		}
-		struct Data num = { .type = Number, .number = part->parts.len };
-		listPush(section, num);
-		int error = exportHTMLBody(
-			file, envelope, section,
-			&part->parts.ptr[part->parts.len - 1],
-			dataCheck(body, List).list.ptr[part->parts.len - 1]
-		);
-		section->len--;
-		return error;
+	}
 
-	} else if (part->multipart) {
+	if (part->multipart) {
 		int error;
 		bool attached = false;
 		for (size_t i = 0; i < part->parts.len; ++i) {
g/?h=3.3.1p1'>3.3.1p1June McEnroe 2021-03-05build: Add OpenSSL includes to libcompatJune McEnroe 2020-12-15Import LibreSSL 3.3.1June McEnroe 2020-11-24Import LibreSSL 3.3.0June McEnroe 2020-10-22Import LibreSSL 3.2.2June McEnroe 2020-09-29Import LibreSSL 3.2.1June McEnroe 2020-09-29import: Add m4/ax_add_fortify_source.m4June McEnroe 2020-08-05build: Add README.7 to EXTRA_DIST 3.2.0June McEnroe 2020-08-03doc: Indicate that only OpenSSL 1.1.1b and newer workJune McEnroe document 'head-include'Lars Hjemli 2009-07-25ui-blob: return 'application/octet-stream' for binary blobsLars Hjemli 2009-07-25ui-plain: Return 'application/octet-stream' for binary files.Remko Tronçon 2009-06-11use cgit_httpscheme() for atom feedDiego Ongaro 2009-06-11add cgit_httpscheme() -> http:// or https://Diego Ongaro 2009-06-07Return http statuscode 404 on unknown branchLars Hjemli 2009-06-07Add head-include configuration option.Mark Lodato 2009-03-15CGIT 0.8.2.1Lars Hjemli 2009-03-15Fix doc-related glitches in Makefile and .gitignoreLars Hjemli 2009-03-15ui-snapshot: avoid segfault when no filename is specifiedLars Hjemli 2009-03-15fix segfault when displaying empty blobsEric Wong 2009-02-19Add support for HEAD requestsLars Hjemli 2009-02-19Add support for ETag in 'plain' viewLars Hjemli 2009-02-12ui-tree: escape ascii-text properly in hexdump viewLars Hjemli 2009-02-12Makefile: add doc-related targetsLars Hjemli