summary refs log tree commit diff
path: root/main.c
diff options
context:
space:
mode:
authorwrmr2025-03-08 18:13:32 -0500
committerwrmr2025-03-08 18:13:32 -0500
commit4dda367d09e769fff4a8b20cde07d634ef062e0c (patch)
tree3eeba128d87d9e1c8f59bb44590e5c132d1bb042 /main.c
parent630ad3e59da9509962d51ac907496e86aec0c9cc (diff)
add newlines after html elements in standalone mode
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/main.c b/main.c
index 1f9876e..634127f 100644
--- a/main.c
+++ b/main.c
@@ -362,13 +362,13 @@ int main(int argc, const char **argv) {
 			doc = doc->prev;
 			if (doc->title.s) title = doc->title;
 		}
-		Str thtml = S("<!DOCTYPE html>"
-				"<meta charset=utf-8>"
-				"<meta name=viewport content='width=device-width,initial-scale=1'>");
+		Str thtml = S("<!DOCTYPE html>\n"
+				"<meta charset=utf-8>\n"
+				"<meta name=viewport content='width=device-width,initial-scale=1'>\n");
 		if (title.s) {
 			str_cat(&thtml, S("<title>"), &scratch);
 			str_cat_html(&thtml, title, &scratch);
-			str_cat(&thtml, S("</title>"), &scratch);
+			str_cat(&thtml, S("</title>\n"), &scratch);
 		}
 
 		if (opts.stylesheet.s) {
@@ -384,7 +384,7 @@ int main(int argc, const char **argv) {
 				fprintf(stderr, "failed to read stylesheet: %s\n", strerror(errno));
 				return 1;
 			}
-			str_cat(&thtml, S("<style>"), &scratch);
+			str_cat(&thtml, S("<style>\n"), &scratch);
 			if (opts.hvarc > 0) {
 				str_cat(&thtml, S(":root{"), &scratch);
 				for (int i = 0; i < opts.hvarc; i++) {
@@ -402,7 +402,7 @@ int main(int argc, const char **argv) {
 				str_catc(&thtml, '}', &scratch);
 			}
 			str_cat(&thtml, css, &scratch);
-			str_cat(&thtml, S("</style>"), &scratch);
+			str_cat(&thtml, S("</style>\n"), &scratch);
 			perm = p;
 		}