From 83e23c71985ce8e10c5d1515d134cc386b3c476c Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 11 May 2020 12:46:17 -0400 Subject: Eliminate stray whitespace in HTML and Atom --- atom.c | 90 ++++++++++++++++++++++++++++++++---------------------------------- 1 file changed, 44 insertions(+), 46 deletions(-) (limited to 'atom.c') diff --git a/atom.c b/atom.c index 7bc4fe9..35cc840 100644 --- a/atom.c +++ b/atom.c @@ -31,12 +31,12 @@ static char *atomID(const struct Envelope *envelope) { } static int atomAuthor(FILE *file, struct Address addr) { - const char *template = TEMPLATE( - - [name] - [mailbox]@[host] - - ); + const char *template = { + Q() + Q([name]) + Q([mailbox]@[host]) + Q() + }; struct Variable vars[] = { { "name", addressName(addr) }, { "mailbox", addr.mailbox }, @@ -62,13 +62,13 @@ static const char *atomUpdated(time_t time) { } int atomEntryOpen(FILE *file, const struct Envelope *envelope) { - const char *template = TEMPLATE( - - [id] - [title] - [updated] - - ); + const char *template = { + Q() + Q([id]) + Q([title]) + Q([updated]) + Q() + }; char *id = atomID(envelope); char *url = atomEntryURL(envelope); struct Variable vars[] = { @@ -88,13 +88,13 @@ int atomEntryOpen(FILE *file, const struct Envelope *envelope) { } int atomContent(FILE *file, const char *content) { - const char *template = TEMPLATE( - -
-
[content]
-
-
- ); + const char *template = { + Q() + Q(
) + Q(
[content]
) + Q(
) + Q(
) + }; struct Variable vars[] = { { "content", content }, {0}, @@ -103,7 +103,7 @@ int atomContent(FILE *file, const char *content) { } int atomEntryClose(FILE *file) { - return templateRender(file, TEMPLATE(
), NULL, NULL); + return templateRender(file, Q(
), NULL, NULL); } static char *atomThreadURL(const struct Envelope *envelope, const char *type) { @@ -116,23 +116,22 @@ static char *atomThreadURL(const struct Envelope *envelope, const char *type) { } int atomThreadOpen(FILE *file, const struct Envelope *envelope) { - const char *template = TEMPLATE( - <[q]xml version="1.0" encoding="utf-8"[q]> - - bubger - [id] - [title] - [updated] - - - - ); + const char *template = { + "" + Q() + Q(bubger) + Q([id]) + Q([title]) + Q([updated]) + Q() + Q() + Q() + }; char *id = atomID(envelope); char *atom = atomThreadURL(envelope, "atom"); char *html = atomThreadURL(envelope, "html"); char *mbox = atomThreadURL(envelope, "mbox"); struct Variable vars[] = { - { "q", "?" }, { "generator", GENERATOR_URL }, { "id", id }, { "title", envelope->subject }, @@ -154,22 +153,21 @@ int atomThreadOpen(FILE *file, const struct Envelope *envelope) { } int atomThreadClose(FILE *file) { - return templateRender(file, TEMPLATE(), NULL, NULL); + return templateRender(file, Q(), NULL, NULL); } int atomIndexOpen(FILE *file) { - const char *template = TEMPLATE( - <[q]xml version="1.0" encoding="utf-8"[q]> - - bubger - mailto:[mailto] - [title] - [updated] - - - ); + const char *template = { + "" + Q() + Q(bubger) + Q(mailto:[mailto]) + Q([title]) + Q([updated]) + Q() + Q() + }; struct Variable vars[] = { - { "q", "?" }, { "generator", GENERATOR_URL }, { "mailto", baseMailto }, { "title", baseTitle }, @@ -181,5 +179,5 @@ int atomIndexOpen(FILE *file) { } int atomIndexClose(FILE *file) { - return templateRender(file, TEMPLATE(), NULL, NULL); + return templateRender(file, Q(), NULL, NULL); } -- cgit 1.4.1