Simplify diff markup

Remove <span> for inserted/deleted lines and use
the <a> for coloring.
This commit is contained in:
Eivind Uggedal 2015-12-09 09:43:20 +00:00 committed by Hiltjo Posthuma
parent 1363b8b51e
commit b634cfd860
2 changed files with 6 additions and 10 deletions

View file

@ -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;
}

View file

@ -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);