diff --git a/ui-diff.c b/ui-diff.c
index a824546..8956b13 100644
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -233,11 +233,11 @@ static void print_line(char *line, int len)
else if (line[0] == '@')
class = "hunk";
- htmlf("<div class='%s'>", class);
+ htmlf("<span class='%s'>", class);
line[len-1] = '\0';
html_txt(line);
- html("</div>");
line[len-1] = c;
+ html("</span>\n");
}
static void header(const struct object_id *oid1, char *path1, int mode1,
@@ -247,17 +247,18 @@ static void header(const struct object_id *oid1, char *path1, int mode1,
int subproject;
subproject = (S_ISGITLINK(mode1) || S_ISGITLINK(mode2));
- html("<div class='head'>");
+ html("<span class='head'>");
html("diff --git a/");
html_txt(path1);
html(" b/");
html_txt(path2);
+ html("\n");
if (mode1 == 0)
- htmlf("<br/>new file mode %.6o", mode2);
+ htmlf("new file mode %.6o\n", mode2);
if (mode2 == 0)
- htmlf("<br/>deleted file mode %.6o", mode1);
+ htmlf("deleted file mode %.6o\n", mode1);
if (!subproject) {
abbrev1 = xstrdup(repo_find_unique_abbrev(the_repository, oid1, DEFAULT_ABBREV));
@@ -270,28 +271,31 @@ static void header(const struct object_id *oid1, char *path1, int mode1,
if (mode2 != mode1)
htmlf("..%.6o", mode2);
}
+ html("\n");
if (is_null_oid(oid1)) {
path1 = "dev/null";
- html("<br/>--- /");
+ html("--- /");
} else
- html("<br/>--- a/");
+ html("--- a/");
if (mode1 != 0)
cgit_tree_link(path1, NULL, NULL, ctx.qry.head,
oid_to_hex(old_rev_oid), path1);
else
html_txt(path1);
+ html("\n");
if (is_null_oid(oid2)) {
path2 = "dev/null";
- html("<br/>+++ /");
+ html("+++ /");
} else
- html("<br/>+++ b/");
+ html("+++ b/");
if (mode2 != 0)
cgit_tree_link(path2, NULL, NULL, ctx.qry.head,
oid_to_hex(new_rev_oid), path2);
else
html_txt(path2);
+ html("\n");
}
- html("</div>");
+ html("</span>");
}
static void filepair_cb(struct diff_filepair *pair)
@@ -490,12 +494,12 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
html("<table summary='ssdiff' class='ssdiff'>");
} else {
html("<table summary='diff' class='diff'>");
- html("<tr><td>");
+ html("<tr><td><pre>");
}
cgit_diff_tree(old_rev_oid, new_rev_oid, filepair_cb, prefix,
ctx.qry.ignorews);
if (!use_ssdiff)
- html("</td></tr>");
+ html("</pre></td></tr>");
html("</table>");
if (show_ctrls)
|