Simplify diff markup
Remove <span> for inserted/deleted lines and use the <a> for coloring.
This commit is contained in:
parent
1363b8b51e
commit
b634cfd860
10
style.css
10
style.css
|
@ -50,18 +50,14 @@ pre .h {
|
||||||
color: darkcyan;
|
color: darkcyan;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre .i {
|
pre a.i {
|
||||||
color: green;
|
color: green;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre .d {
|
pre a.d {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre span a {
|
pre a.i:hover, pre a.d:hover {
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre span a:hover {
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
6
urmoms.c
6
urmoms.c
|
@ -333,16 +333,16 @@ printshowfile(struct commitinfo *ci)
|
||||||
if (git_patch_get_line_in_hunk(&line, patch, j, k))
|
if (git_patch_get_line_in_hunk(&line, patch, j, k))
|
||||||
break;
|
break;
|
||||||
if (line->old_lineno == -1)
|
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);
|
j, k, j, k);
|
||||||
else if (line->new_lineno == -1)
|
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);
|
j, k, j, k);
|
||||||
else
|
else
|
||||||
fputc(' ', fp);
|
fputc(' ', fp);
|
||||||
xmlencode(fp, line->content, line->content_len);
|
xmlencode(fp, line->content, line->content_len);
|
||||||
if (line->old_lineno == -1 || line->new_lineno == -1)
|
if (line->old_lineno == -1 || line->new_lineno == -1)
|
||||||
fputs("</a></span>", fp);
|
fputs("</a>", fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
git_patch_free(patch);
|
git_patch_free(patch);
|
||||||
|
|
Loading…
Reference in a new issue