summary refs log tree commit diff
path: root/export.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--export.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/export.c b/export.c
index 3c6a31f..1e07acd 100644
--- a/export.c
+++ b/export.c
@@ -115,7 +115,7 @@ static int exportHTMLBody(
 	FILE *file, struct List *section,
 	const struct BodyPart *structure, struct Data body
 ) {
-	int error;
+	int error = 0;
 	if (structure->multipart) {
 		// TODO: Choose a part from multipart/alternative.
 		for (size_t i = 0; i < structure->parts.len; ++i) {
@@ -133,9 +133,13 @@ static int exportHTMLBody(
 			|| htmlMessageOpen(file, structure->message.envelope)
 			|| exportHTMLBody(file, section, structure->message.structure, body)
 			|| htmlMessageClose(file);
-	} else {
-		// TODO: Content.
-		error = 0;
+	} else if (bodyPartType(structure, "text", "plain")) {
+		// TODO: Check if not inline.
+		const char *content = dataCheck(body, String).string;
+		error = 0
+			|| htmlInlineOpen(file, structure)
+			|| decodeContent(file, escapeXML, structure, content)
+			|| htmlInlineClose(file);
 	}
 	return error;
 }