From 789eb08b07695808f738b6fade1894bdc681940c Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Thu, 9 Apr 2020 22:51:09 -0400 Subject: URL encode the fragment link --- html.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/html.c b/html.c index e404434..f078b75 100644 --- a/html.c +++ b/html.c @@ -30,7 +30,7 @@ static const char *Mailto = { static const char *Summary = TEMPLATE(
-

[subject]

+

[subject]

[from]
@@ -41,6 +41,12 @@ static const char *Address = TEMPLATE( ); int htmlEnvelope(FILE *file, const struct Envelope *envelope) { + struct Variable fragmentVars[] = { + { "messageID", envelope->messageID }, + {0}, + }; + char *fragment = templateURL("#[messageID]", fragmentVars); + struct Variable mailtoVars[] = { { "mailbox", envelope->replyTo.mailbox }, { "host", envelope->replyTo.host }, @@ -62,6 +68,7 @@ int htmlEnvelope(FILE *file, const struct Envelope *envelope) { struct Variable summaryVars[] = { { "messageID", envelope->messageID }, + { "fragment", fragment }, { "subject", envelope->subject }, { "mailto", mailto }, { "from", from }, @@ -70,6 +77,7 @@ int htmlEnvelope(FILE *file, const struct Envelope *envelope) { {0}, }; int error = templateRender(file, Summary, summaryVars, escapeXML); + free(fragment); free(mailto); if (error) return error; -- cgit 1.4.1