commit: c99169db3dd78762b9819b830bdfece9a13e800c
parent 7e717cbf74bf22d0240cb2ed84a31d15e64e98d9
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sat, 10 Oct 2020 07:35:57 +0200
stagit: Fix code numbering selection
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/stagit.c b/stagit.c
@@ -569,31 +569,31 @@ size_t
writeblobhtml(FILE *fp, const git_blob *blob)
{
size_t n = 0, i, len, prev;
- const char *nfmt = "<a href=\"#l%zu\" class=\"line\" id=\"l%zu\">%7zu</a> ";
const char *s = git_blob_rawcontent(blob);
len = git_blob_rawsize(blob);
- fputs("<pre id=\"blob\">\n", fp);
+ fputs("<pre id=\"blob\"><ol>\n", fp);
if (len > 0) {
for (i = 0, prev = 0; i < len; i++) {
if (s[i] != '\n')
continue;
n++;
- fprintf(fp, nfmt, n, n, n);
+ fprintf(fp, "<li class=\"line\" id=\"l%zu\">", n);
xmlencodeline(fp, &s[prev], i - prev + 1);
- putc('\n', fp);
+ fprintf(fp, "</li>");
prev = i + 1;
}
/* trailing data */
if ((len - prev) > 0) {
n++;
- fprintf(fp, nfmt, n, n, n);
+ fprintf(fp, "<li class=\"line\" id=\"l%zu\">", n);
xmlencodeline(fp, &s[prev], len - prev);
+ fprintf(fp, "</li>");
}
}
- fputs("</pre>\n", fp);
+ fputs("</ol></pre>\n", fp);
return n;
}