about summary refs log tree commit diff
path: root/html.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-16 10:16:20 -0400
committerJune McEnroe <june@causal.agency>2020-04-16 10:16:20 -0400
commit44439c698fae09acbd3c363f26cd20386d6282c6 (patch)
tree76cc1f82290b17032496c09f23acb749fa8d74f4 /html.c
parentWrap subthreads in <details> with reply count (diff)
downloadbubger-44439c698fae09acbd3c363f26cd20386d6282c6.tar.gz
bubger-44439c698fae09acbd3c363f26cd20386d6282c6.zip
Render message links before to/cc
Diffstat (limited to 'html.c')
-rw-r--r--html.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/html.c b/html.c
index 352e229..677bed0 100644
--- a/html.c
+++ b/html.c
@@ -102,7 +102,7 @@ static char *htmlMbox(const struct Envelope *envelope) {
 
 int htmlMessageOpen(FILE *file, const struct Envelope *envelope) {
 	// TODO: Conditionally include mailto: link.
-	const char *template1 = TEMPLATE(
+	const char *template = TEMPLATE(
 		<article class="message" id="[messageID]">
 		<header>
 			<h2>[subject]</h2>
@@ -110,15 +110,12 @@ int htmlMessageOpen(FILE *file, const struct Envelope *envelope) {
 				<a href="[mailto]">[from]</a>
 			</address>
 			<time datetime="[utc]">[date]</time>
-	);
-	const char *template2 = TEMPLATE(
 			<nav>
 				<ul>
 					<li><a href="[fragment]">permalink</a></li>
 					<li><a href="[mbox]">mbox</a></li>
 				</ul>
 			</nav>
-		</header>
 	);
 	char *mailto = htmlMailto(envelope);
 	char utc[sizeof("0000-00-00T00:00:00Z")];
@@ -137,10 +134,10 @@ int htmlMessageOpen(FILE *file, const struct Envelope *envelope) {
 		{0},
 	};
 	int error = 0
-		|| templateRender(file, template1, vars, escapeXML)
+		|| templateRender(file, template, vars, escapeXML)
 		|| htmlAddressList(file, "to", envelope->to)
 		|| htmlAddressList(file, "cc", envelope->cc)
-		|| templateRender(file, template2, vars, escapeXML);
+		|| templateRender(file, TEMPLATE(</header>), NULL, NULL);
 	free(mailto);
 	free(fragment);
 	free(mbox);