]> git.armaanb.net Git - stagit.git/commitdiff
Simplify diff markup
authorEivind Uggedal <eivind@uggedal.com>
Wed, 9 Dec 2015 09:43:20 +0000 (09:43 +0000)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Wed, 9 Dec 2015 21:15:25 +0000 (22:15 +0100)
Remove <span> for inserted/deleted lines and use
the <a> for coloring.

style.css
urmoms.c

index d7de757318e3379f610cff5cf3276d9bf7c1d0d4..2823efb6b67a5bdd7be78b75696f13b50d52aff7 100644 (file)
--- a/style.css
+++ b/style.css
@@ -50,18 +50,14 @@ pre .h {
        color: darkcyan;
 }
 
-pre .i {
+pre a.i {
        color: green;
 }
 
-pre .d {
+pre a.d {
        color: red;
 }
 
-pre span a {
-       color: inherit;
-}
-
-pre span a:hover {
+pre a.i:hover, pre a.d:hover {
        text-decoration: none;
 }
index 01aebb14b31ff3fe8143efa1ccdbd0a80d1647d4..8167d0fd28c5c70a89d057423edc8a51809d86db 100644 (file)
--- a/urmoms.c
+++ b/urmoms.c
@@ -333,16 +333,16 @@ printshowfile(struct commitinfo *ci)
                                if (git_patch_get_line_in_hunk(&line, patch, j, k))
                                        break;
                                if (line->old_lineno == -1)
-                                       fprintf(fp, "<span class=\"i\"><a href=\"#h%zu-%zu\" id=\"h%zu-%zu\">+",
+                                       fprintf(fp, "<a href=\"#h%zu-%zu\" id=\"h%zu-%zu\" class=\"i\">+",
                                                j, k, j, k);
                                else if (line->new_lineno == -1)
-                                       fprintf(fp, "<span class=\"d\"><a href=\"#h%zu-%zu\" id=\"h%zu-%zu\">-",
+                                       fprintf(fp, "<a href=\"#h%zu-%zu\" id=\"h%zu-%zu\" class=\"d\">-",
                                                j, k, j, k);
                                else
                                        fputc(' ', fp);
                                xmlencode(fp, line->content, line->content_len);
                                if (line->old_lineno == -1 || line->new_lineno == -1)
-                                       fputs("</a></span>", fp);
+                                       fputs("</a>", fp);
                        }
                }
                git_patch_free(patch);