ctucx.git: stagit

ctucx' stagit fork

commit 671c6e17a1a68cce132065b7636a4fc36858b289
parent af5fb6ffabd9a4c16cb2b3362df7995e0330660b
Author: Leah (ctucx) <leah@ctu.cx>
Date: Tue, 24 May 2022 10:24:49 +0200

writerefs: refactor html output
1 file changed, 9 insertions(+), 8 deletions(-)
M
stagit.c
|
17
+++++++++--------
diff --git a/stagit.c b/stagit.c
@@ -1169,18 +1169,19 @@ writerefs(FILE *fp)
 	for (i = 0, j = 0, count = 0; i < refcount; i++) {
 		if (j == 0 && git_reference_is_tag(ris[i].ref)) {
 			if (count)
-				fputs("</tbody></table><br/>\n", fp);
+				fputs("</tbody></table><br>", fp);
 			count = 0;
 			j = 1;
 		}
 
 		/* print header if it has an entry (first). */
 		if (++count == 1) {
-			fprintf(fp, "<h2>%s</h2><table id=\"%s\">"
-		                "<thead>\n<tr><td><b>Name</b></td>"
-			        "<td><b>Last commit date</b></td>"
-			        "<td><b>Author</b></td>\n</tr>\n"
-			        "</thead><tbody>\n",
+			fprintf(fp, "<h2>%s</h2>"
+						"<table class=\"%s\"><thead><tr>"
+						"<td>Name</td>"
+						"<td>Last commit date</td>"
+						"<td>Author</td>"
+						"</tr></thead><tbody>",
 			         titles[j], ids[j]);
 		}
 

@@ -1195,11 +1196,11 @@ writerefs(FILE *fp)
 		fputs("</td><td>", fp);
 		if (ci->author)
 			xmlencode(fp, ci->author->name, strlen(ci->author->name));
-		fputs("</td></tr>\n", fp);
+		fputs("</td></tr>", fp);
 	}
 	/* table footer */
 	if (count)
-		fputs("</tbody></table><br/>\n", fp);
+		fputs("</tbody></table><br>", fp);
 
 	for (i = 0; i < refcount; i++) {
 		commitinfo_free(ris[i].ci);