make hunk line itself a link
authorHiltjo Posthuma <hiltjo@codemadness.org>
Tue, 5 Jan 2016 20:42:10 +0000 (21:42 +0100)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Tue, 5 Jan 2016 20:42:10 +0000 (21:42 +0100)
stagit.c

index aad7386cc6827a2ab92393ad068cd47937d30bba..22b639e2b8d9cb0ee8d6e828bb9e166ec87927a8 100644 (file)
--- a/stagit.c
+++ b/stagit.c
@@ -409,9 +409,9 @@ printshowfile(struct commitinfo *ci)
                        if (git_patch_get_hunk(&hunk, &nhunklines, patch, j))
                                break;
 
-                       fputs("<span class=\"h\">", fp);
+                       fprintf(fp, "<a href=\"#h%zu\" id=\"h%zu\" class=\"h\">", j, j);
                        xmlencode(fp, hunk->header, hunk->header_len);
-                       fputs("</span>", fp);
+                       fputs("</a>", fp);
 
                        for (k = 0; ; k++) {
                                if (git_patch_get_line_in_hunk(&line, patch, j, k))