From e7e2d7e6bb8a5a54f1efe049858526392168ba30 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Thu, 30 Apr 2020 12:34:19 -0400 Subject: Nest elements for increased levels of quotation --- html.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'html.c') diff --git a/html.c b/html.c index ee9e966..12f3ff0 100644 --- a/html.c +++ b/html.c @@ -253,6 +253,23 @@ static int htmlMarkupURLs(FILE *file, char *buf) { return escapeXML(file, ptr); } +static int htmlMarkupQuote(FILE *file, char *buf) { + int error; + size_t level = 0; + for (char *ch = buf; *ch == '>' || *ch == ' '; level += (*ch++ == '>')); + for (size_t i = 0; i < level; ++i) { + error = templateRender(file, TEMPLATE(), NULL, NULL); + if (error) return error; + } + error = htmlMarkupURLs(file, buf); + if (error) return error; + for (size_t i = 0; i < level; ++i) { + error = templateRender(file, TEMPLATE(), NULL, NULL); + if (error) return error; + } + return 0; +} + static int htmlMarkup(FILE *file, const char *content) { int error = 0; size_t cap = 0; @@ -299,10 +316,7 @@ static int htmlMarkup(FILE *file, const char *content) { } else if (patch) { error = escapeXML(file, buf); } else if (buf[0] == '>') { - error = 0 - || templateRender(file, TEMPLATE(), NULL, NULL) - || htmlMarkupURLs(file, buf) - || templateRender(file, TEMPLATE(), NULL, NULL); + error = htmlMarkupQuote(file, buf); } else { error = htmlMarkupURLs(file, buf); } -- cgit 1.4.1 rep'>log msg
path: root/doc (unfollow)
Commit message (Expand)Author
2022-05-29Add The Bone Shard DaughterJune McEnroe
2022-05-16Add all possible hostnames to ssh configJune McEnroe
2022-05-16Add back grc aliasJune McEnroe
2022-05-10Update "Care" with certificate timelineJune McEnroe
2022-05-08Add CirceJune McEnroe
2022-04-20Revert "Make (pun) the dependencies make (pun) more sense"June McEnroe
2022-04-20Set txt mtimes to source mtimesJune McEnroe
2022-04-20Make (pun) the dependencies make (pun) more senseJune McEnroe
2022-04-17Add HenchJune McEnroe
2022-04-14Publish "Agency"June McEnroe
2022-04-13Swap dates so the difference is always positiveJune McEnroe
2022-04-04Update "Care"June McEnroe
2022-04-03Publish "Care"June McEnroe
2022-03-31Publish "Compassion"June McEnroe
2022-03-24Skip matches with ident chars on either sideJune McEnroe
2022-03-24Add The Invisible Life of Addie LaRueJune McEnroe
2022-03-22Source ~/.profile.local if it existsJune McEnroe
2022-03-18Publish "Addendum 2021"June McEnroe
2022-03-16Remove wcwidth portJune McEnroe
2022-03-16Remove -j4 from ./PlanJune McEnroe
2022-03-15Rewrite Linux install.sh for DebianJune McEnroe
2022-03-15Remove dashJune McEnroe