summary refs log tree commit diff
path: root/www
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-01-01 11:44:51 +0000
committerJune McEnroe <june@causal.agency>2021-01-17 19:07:04 +0000
commitde881cadccb97b2de9c4557f5f78411559fe747c (patch)
tree27f5a76b601f577f9f15fddbbf8c93b0d552ebd2 /www
parentImprove pageheader display on text-based browsers (diff)
downloadsrc-de881cadccb97b2de9c4557f5f78411559fe747c.tar.gz
src-de881cadccb97b2de9c4557f5f78411559fe747c.zip
Use <pre> for commit-msg
This preserves formatting readable for users of text-based browsers
without CSS support.
Diffstat (limited to '')
-rw-r--r--www/git.causal.agency/cgit/cgit.css5
-rwxr-xr-xwww/git.causal.agency/cgit/tests/t0105-commit.sh2
-rw-r--r--www/git.causal.agency/cgit/ui-commit.c4
-rw-r--r--www/git.causal.agency/cgit/ui-tag.c4
4 files changed, 5 insertions, 10 deletions
diff --git a/www/git.causal.agency/cgit/cgit.css b/www/git.causal.agency/cgit/cgit.css
index ba210b41..67e1ed36 100644
--- a/www/git.causal.agency/cgit/cgit.css
+++ b/www/git.causal.agency/cgit/cgit.css
@@ -437,11 +437,6 @@ div#cgit div.commit-subject {
 	padding: 0em;
 }
 
-div#cgit div.commit-msg {
-	white-space: pre;
-	font-family: monospace;
-}
-
 div#cgit div.notes-header {
 	font-weight: bold;
 	padding-top: 1.5em;
diff --git a/www/git.causal.agency/cgit/tests/t0105-commit.sh b/www/git.causal.agency/cgit/tests/t0105-commit.sh
index 9cdf55c0..9e34abd2 100755
--- a/www/git.causal.agency/cgit/tests/t0105-commit.sh
+++ b/www/git.causal.agency/cgit/tests/t0105-commit.sh
@@ -11,7 +11,7 @@ test_expect_success 'find commit subject' '
 	grep "<div class=.commit-subject.>commit 5<" tmp
 '
 
-test_expect_success 'find commit msg' 'grep "<div class=.commit-msg.></div>" tmp'
+test_expect_success 'find commit msg' 'grep "<pre class=.commit-msg.></pre>" tmp'
 test_expect_success 'find diffstat' 'grep "<table summary=.diffstat. class=.diffstat.>" tmp'
 
 test_expect_success 'find diff summary' '
diff --git a/www/git.causal.agency/cgit/ui-commit.c b/www/git.causal.agency/cgit/ui-commit.c
index 7d87c0a3..ee5d2c7e 100644
--- a/www/git.causal.agency/cgit/ui-commit.c
+++ b/www/git.causal.agency/cgit/ui-commit.c
@@ -121,11 +121,11 @@ void cgit_print_commit(char *hex, const char *prefix)
 	cgit_close_filter(ctx.repo->commit_filter);
 	show_commit_decorations(commit);
 	html("</div>");
-	html("<div class='commit-msg'>");
+	html("<pre class='commit-msg'>");
 	cgit_open_filter(ctx.repo->commit_filter);
 	html_txt(info->msg);
 	cgit_close_filter(ctx.repo->commit_filter);
-	html("</div>");
+	html("</pre>");
 	if (notes.len != 0) {
 		html("<div class='notes-header'>Notes</div>");
 		html("<div class='notes'>");
diff --git a/www/git.causal.agency/cgit/ui-tag.c b/www/git.causal.agency/cgit/ui-tag.c
index 846d5b14..c499516d 100644
--- a/www/git.causal.agency/cgit/ui-tag.c
+++ b/www/git.causal.agency/cgit/ui-tag.c
@@ -25,9 +25,9 @@ static void print_tag_content(char *buf)
 	html_txt(buf);
 	html("</div>");
 	if (p) {
-		html("<div class='commit-msg'>");
+		html("<pre class='commit-msg'>");
 		html_txt(++p);
-		html("</div>");
+		html("</pre>");
 	}
 }