diff options
author | Eric Wong | 2019-01-01 11:44:51 +0000 |
---|---|---|
committer | June McEnroe | 2022-02-13 11:53:56 -0500 |
commit | 2843093cb4f1ef9bc62f2ed2451a503c386c388a (patch) | |
tree | 5fa6487f20dd44ad0b4e9aa5df9df784b50a657a | |
parent | Improve pageheader display on text-based browsers (diff) | |
download | cgit-2843093cb4f1ef9bc62f2ed2451a503c386c388a.tar.gz cgit-2843093cb4f1ef9bc62f2ed2451a503c386c388a.zip |
Use <pre> for commit-msg
This preserves formatting readable for users of text-based browsers without CSS support.
-rw-r--r-- | cgit.css | 5 | ||||
-rwxr-xr-x | tests/t0105-commit.sh | 2 | ||||
-rw-r--r-- | ui-commit.c | 4 | ||||
-rw-r--r-- | ui-tag.c | 4 |
4 files changed, 5 insertions, 10 deletions
diff --git a/cgit.css b/cgit.css index ba210b4..67e1ed3 100644 --- a/cgit.css +++ b/cgit.css | |||
@@ -437,11 +437,6 @@ div#cgit div.commit-subject { | |||
437 | padding: 0em; | 437 | padding: 0em; |
438 | } | 438 | } |
439 | 439 | ||
440 | div#cgit div.commit-msg { | ||
441 | white-space: pre; | ||
442 | font-family: monospace; | ||
443 | } | ||
444 | |||
445 | div#cgit div.notes-header { | 440 | div#cgit div.notes-header { |
446 | font-weight: bold; | 441 | font-weight: bold; |
447 | padding-top: 1.5em; | 442 | padding-top: 1.5em; |
diff --git a/tests/t0105-commit.sh b/tests/t0105-commit.sh index 9cdf55c..9e34abd 100755 --- a/tests/t0105-commit.sh +++ b/tests/t0105-commit.sh | |||
@@ -11,7 +11,7 @@ test_expect_success 'find commit subject' ' | |||
11 | grep "<div class=.commit-subject.>commit 5<" tmp | 11 | grep "<div class=.commit-subject.>commit 5<" tmp |
12 | ' | 12 | ' |
13 | 13 | ||
14 | test_expect_success 'find commit msg' 'grep "<div class=.commit-msg.></div>" tmp' | 14 | test_expect_success 'find commit msg' 'grep "<pre class=.commit-msg.></pre>" tmp' |
15 | test_expect_success 'find diffstat' 'grep "<table summary=.diffstat. class=.diffstat.>" tmp' | 15 | test_expect_success 'find diffstat' 'grep "<table summary=.diffstat. class=.diffstat.>" tmp' |
16 | 16 | ||
17 | test_expect_success 'find diff summary' ' | 17 | test_expect_success 'find diff summary' ' |
diff --git a/ui-commit.c b/ui-commit.c index 7d87c0a..ee5d2c7 100644 --- a/ui-commit.c +++ b/ui-commit.c | |||
@@ -121,11 +121,11 @@ void cgit_print_commit(char *hex, const char *prefix) | |||
121 | cgit_close_filter(ctx.repo->commit_filter); | 121 | cgit_close_filter(ctx.repo->commit_filter); |
122 | show_commit_decorations(commit); | 122 | show_commit_decorations(commit); |
123 | html("</div>"); | 123 | html("</div>"); |
124 | html("<div class='commit-msg'>"); | 124 | html("<pre class='commit-msg'>"); |
125 | cgit_open_filter(ctx.repo->commit_filter); | 125 | cgit_open_filter(ctx.repo->commit_filter); |
126 | html_txt(info->msg); | 126 | html_txt(info->msg); |
127 | cgit_close_filter(ctx.repo->commit_filter); | 127 | cgit_close_filter(ctx.repo->commit_filter); |
128 | html("</div>"); | 128 | html("</pre>"); |
129 | if (notes.len != 0) { | 129 | if (notes.len != 0) { |
130 | html("<div class='notes-header'>Notes</div>"); | 130 | html("<div class='notes-header'>Notes</div>"); |
131 | html("<div class='notes'>"); | 131 | html("<div class='notes'>"); |
diff --git a/ui-tag.c b/ui-tag.c index 846d5b1..c499516 100644 --- a/ui-tag.c +++ b/ui-tag.c | |||
@@ -25,9 +25,9 @@ static void print_tag_content(char *buf) | |||
25 | html_txt(buf); | 25 | html_txt(buf); |
26 | html("</div>"); | 26 | html("</div>"); |
27 | if (p) { | 27 | if (p) { |
28 | html("<div class='commit-msg'>"); | 28 | html("<pre class='commit-msg'>"); |
29 | html_txt(++p); | 29 | html_txt(++p); |
30 | html("</div>"); | 30 | html("</pre>"); |
31 | } | 31 | } |
32 | } | 32 | } |
33 | 33 | ||