List for cgit developers and users
 help / color / mirror / Atom feed
From: e at 80x24.org (Eric Wong)
Subject: [PATCH 2/4] ui-{commit,tag}: use <pre> for commit-msg
Date: Tue,  1 Jan 2019 11:44:51 +0000	[thread overview]
Message-ID: <20190101114453.4876-3-e@80x24.org> (raw)
In-Reply-To: <20190101114453.4876-1-e@80x24.org>

This preserves formatting readable for users of text-based browsers
without CSS support.
---
 cgit.css              | 5 -----
 tests/t0105-commit.sh | 2 +-
 ui-commit.c           | 4 ++--
 ui-tag.c              | 4 ++--
 4 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/cgit.css b/cgit.css
index 8c313e2..9f70d14 100644
--- a/cgit.css
+++ b/cgit.css
@@ -436,11 +436,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/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' '
 	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/ui-commit.c b/ui-commit.c
index 9a47b54..1c04c87 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -120,11 +120,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/ui-tag.c b/ui-tag.c
index f530224..9e54d2c 100644
--- a/ui-tag.c
+++ b/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>");
 	}
 }
 
-- 
EW



  parent reply	other threads:[~2019-01-01 11:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-01 11:44 [PATCH 0/4] improve rendering w/o CSS reliance e
2019-01-01 11:44 ` [PATCH 1/4] ui-shared: improve pageheader display on text-based browsers e
2019-01-01 11:44 ` e [this message]
2019-01-01 11:44 ` [PATCH 3/4] ui-log: improve decoration display for browsers without CSS e
2019-01-01 11:44 ` [PATCH 4/4] ui-diff: preserve spaces w/o CSS on context lines e
2019-01-04 10:32   ` e
2019-01-04 22:23 ` [PATCH 5/4] ui-{tree,repolist}: improve button spacing for browsers w/o CSS e
2020-02-08 18:44 ` [PATCH 0/4] improve rendering w/o CSS reliance e

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190101114453.4876-3-e@80x24.org \
    --to=cgit@lists.zx2c4.com \
    --subject='Re: [PATCH 2/4] ui-{commit,tag}: use <pre> for commit-msg' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).