summary refs log tree commit diff
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
parentWrap subthreads in <details> with reply count (diff)
downloadbubger-44439c698fae09acbd3c363f26cd20386d6282c6.tar.gz
bubger-44439c698fae09acbd3c363f26cd20386d6282c6.zip
Render message links before to/cc
-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);
se htmlf with non-formatted stringsChris Mayo 2019-02-23ui-ssdiff: resolve HTML5 validation errorsChris Mayo 2019-01-03filters: migrate from luacrypto to luaosslJason A. Donenfeld 2019-01-02ui-shared: fix broken sizeof in title setting and rewriteJason A. Donenfeld 2018-12-09git: update to v2.20.0Christian Hesse 2018-11-25ui-blame: set repo for sbJason A. Donenfeld 2018-11-25auth-filter: pass url with query string attachedJason A. Donenfeld 2018-11-21git: use xz compressed archive for downloadChristian Hesse 2018-10-12git: update to v2.19.1Christian Hesse 2018-09-11ui-ssdiff: ban strcat()Christian Hesse 2018-09-11ui-ssdiff: ban strncpy()Christian Hesse 2018-09-11ui-shared: ban strcat()Christian Hesse 2018-09-11ui-patch: ban sprintf()Christian Hesse 2018-09-11ui-log: ban strncpy()Christian Hesse 2018-09-11ui-log: ban strcpy()Christian Hesse 2018-09-11parsing: ban sprintf()Christian Hesse 2018-09-11parsing: ban strncpy()Christian Hesse 2018-08-28filters: generate anchor links from markdownChristian Hesse 2018-08-03Bump version.Jason A. Donenfeld 2018-08-03clone: fix directory traversalJason A. Donenfeld 2018-08-03config: record repo.snapshot-prefix in the per-repo configKonstantin Ryabitsev