From 5bd7e9bc1b6749bbb5220d6c3a990469a7b839ae Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Thu, 21 Feb 2019 19:56:05 +0000 Subject: ui-ssdiff: resolve HTML5 validation errors - Remove ids from anchor elements. They were unusable because they were duplicated between files and versions of files. - Always close span, with html(). - Fix missing / on closing tr element in cgit_ssdiff_header_end(). Signed-off-by: Chris Mayo --- ui-ssdiff.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ui-ssdiff.c') diff --git a/ui-ssdiff.c b/ui-ssdiff.c index c456033..b6dc5b0 100644 --- a/ui-ssdiff.c +++ b/ui-ssdiff.c @@ -207,11 +207,13 @@ static void print_part_with_lcs(char *class, char *line, char *lcs) } } else if (line[i] == lcs[j]) { same = 1; - htmlf(""); + html(""); j += 1; } html_txt(c); } + if (!same) + html(""); } static void print_ssdiff_line(char *class, @@ -236,7 +238,7 @@ static void print_ssdiff_line(char *class, char *fileurl = cgit_fileurl(ctx.repo->url, "tree", old_file->path, id_str); html("%s", lineno_str, lineno_str + 1); + htmlf("'>%s", lineno_str + 1); html(""); htmlf("", class); free(fileurl); @@ -259,7 +261,7 @@ static void print_ssdiff_line(char *class, char *fileurl = cgit_fileurl(ctx.repo->url, "tree", new_file->path, id_str); html("%s", lineno_str, lineno_str + 1); + htmlf("'>%s", lineno_str + 1); html(""); htmlf("", class); free(fileurl); @@ -405,7 +407,7 @@ void cgit_ssdiff_header_begin(void) void cgit_ssdiff_header_end(void) { - html(""); + html(""); } void cgit_ssdiff_footer(void) -- cgit v1.2.3-70-g09d2