summary refs log tree commit diff
diff options
context:
space:
mode:
authorwrmr2025-03-25 23:08:37 -0500
committerwrmr2025-03-25 23:08:37 -0500
commit766767e9c288a9ab321d4dfee717b68079f4e520 (patch)
tree7e28afb1c9906c4edbeebe7b15a185cdb74b3c93
parent4636e9fbcc848297f3e408e5250ccc0a0615bbd2 (diff)
add .links class to link lists
-rw-r--r--main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.c b/main.c
index 2fdf5ae..1f6bb64 100644
--- a/main.c
+++ b/main.c
@@ -262,7 +262,7 @@ void str_cat_blk(Str *out, Block *blk, Arena *perm, Arena *scratch) {
 		Os("</code></pre>");
 		break;
 	case LN_LINK:
-		Os("<ul>\n");
+		Os("<ul class='links'>\n");
 		for (Line *l = blk->lines; l; l = l->next) {
 			Os("<li><a href=");
 			str_cat_uri(out, str_contains(l->url, S("://"))
@@ -295,7 +295,7 @@ void str_cat_blk(Str *out, Block *blk, Arena *perm, Arena *scratch) {
 	case LN_ULIST:
 		Os("<ul>\n");
 		Otl("<li>", l->txt, "</li>\n");
-		Os("<ul>");
+		Os("</ul>");
 		break;
 	case LN_OLIST:
 		Os("<ol>\n");
@@ -334,6 +334,7 @@ int wdoc(FILE *f, Doc **dp, Arena *perm, Arena *scratch) {
 			d->title = blk.data[i].lines->txt;
 		}
 		str_cat_blk(&d->html, &blk.data[i], perm, scratch);
+		if (i + 1 < blk.len) str_cat(&d->html, S("\n"), perm);
 	}
 	*dp = d;
 	return 0;
@@ -528,6 +529,7 @@ int main(int argc, const char **argv) {
 
 	if (opts.standalone) {
 		str_put(html_head(&opts, &perm, &scratch));
+		str_put(S("\n"));
 	}
 
 	while (doc) {