From 8f67d6e0cea4629ae2e1ca6962224aae0be15092 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Wed, 10 Jul 2024 21:53:49 +0200 Subject: Improve line number style for HTML source Make the background of line numbers appear as a single color and increase the contrast to improve readability. Also add a bit of space and a separator line between the numbers and the code itself. --- dpi/vsource.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/dpi/vsource.c b/dpi/vsource.c index 3446be63..58f89f96 100644 --- a/dpi/vsource.c +++ b/dpi/vsource.c @@ -120,12 +120,27 @@ void send_html_text(Dsh *sh, const char *url, int data_size) "\n" "Source for %s\n" "\n" "\n" - "\n\n", url); + "\n
\n", url); while (bytes_read < data_size && (token = a_Dpip_dsh_read_token2(sh, 1, &token_size))) { @@ -135,9 +150,8 @@ void send_html_text(Dsh *sh, const char *url, int data_size) while (*p) { if (line > old_line) { snprintf(line_str, 128, - "
%d%s", - (line & 1) ? "r1" : "r2", line, line, line, - (line == 1 || (line % 10) == 0) ? " " : ""); + "
%d", + line, line, line); a_Dpip_dsh_write_str(sh, 0, line_str); old_line = line; } -- cgit v1.2.3