unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: zimoun <zimon.toutoune@gmail.com>
Cc: maxim.cournoyer@gmail.com, guix.vits@disroot.org, 43166@debbugs.gnu.org
Subject: bug#43166: The issues.guix.gnu.org is hard to read in emacs-w3m.
Date: Tue, 15 Sep 2020 03:06:38 +0200	[thread overview]
Message-ID: <87v9gfx2zl.fsf@elephly.net> (raw)
In-Reply-To: <874ko0xby5.fsf@elephly.net>

[-- Attachment #1: Type: text/plain, Size: 773 bytes --]

The attached patch seems to fix the worst problems.

I’m marking up each line in a message with a “span” tag and a “line”
class; then I use CSS to visually separate the lines.  Simple browsers
that don’t support this CSS rely on “span” to be an inline tag; likewise
they rely on “div” to be a block tag, no matter what the CSS might say.

So the attached patch changes the tag from “span” to “div”, so simple
browsers will render each line on their own instead of joining them.
This seems to have no negative impact on the rendering in other
browsers.  It also shouldn’t be a problem going forward, as popular
powerful browsers allow me to style these “div” tags without
limitations.

What do you think?

-- 
Ricardo



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: p.patch --]
[-- Type: text/x-patch, Size: 5709 bytes --]

diff --git a/assets/css/screen.css b/assets/css/screen.css
index 684bc01..5d8513d 100644
--- a/assets/css/screen.css
+++ b/assets/css/screen.css
@@ -353,28 +353,28 @@ details {
     display: none;
 }
 
-.message span.line {
+.message div.line {
     white-space: pre-wrap;
     font-family: monospace;
     display: block;
 }
 
 /* diff styles */
-.message .diff span.line.diff.file {
+.message .diff div.line.diff.file {
     color: #005cc5;
 }
-.message .diff span.line.diff.separator {
+.message .diff div.line.diff.separator {
     color: #005cc5;
 }
-.message .diff span.line.diff.addition {
+.message .diff div.line.diff.addition {
     color: #22863a;
     background-color: #f0fff4;
 }
-.message .diff span.line.diff.deletion {
+.message .diff div.line.diff.deletion {
     color: #b31d28;
     background-color: #ffeef0;
 }
-.message .diff span.line.diff.range {
+.message .diff div.line.diff.range {
     color: #6f42c1;
     font-weight: bold;
 }
@@ -394,7 +394,7 @@ details {
 }
 
 /* quote styles */
-.message .quote span.line {
+.message .quote div.line {
     color: #3868cc;
 }
 
diff --git a/mumi/web/view/utils.scm b/mumi/web/view/utils.scm
index 3c95644..4a4ecb0 100644
--- a/mumi/web/view/utils.scm
+++ b/mumi/web/view/utils.scm
@@ -68,7 +68,7 @@ with the next context."
        (if (string-prefix? "--8<---------------cut here" line)
            (values blocks #f)
            (values (cons (add-block-line! block
-                                          `(span (@ (class "line")) ,line))
+                                          `(div (@ (class "line")) ,line))
                          other-blocks)
                    context)))
       ((eq? context 'diff)
@@ -79,17 +79,17 @@ with the next context."
            (let ((formatted-line
                   (cond
                    ((string= "---" line)
-                    `(span (@ (class "line diff separator")) ,line))
+                    `(div (@ (class "line diff separator")) ,line))
                    ((string-prefix? "+" line)
-                    `(span (@ (class "line diff addition")) ,line))
+                    `(div (@ (class "line diff addition")) ,line))
                    ((and (string-prefix? "-" line)
                          (not (string= "--" line))
                          (not (string= "-- " line)))
-                    `(span (@ (class "line diff deletion")) ,line))
+                    `(div (@ (class "line diff deletion")) ,line))
                    ((string-prefix? "@@" line)
-                    `(span (@ (class "line diff range")) ,line))
+                    `(div (@ (class "line diff range")) ,line))
                    (else
-                    `(span (@ (class "line")) ,line)))))
+                    `(div (@ (class "line")) ,line)))))
              (values (cons (add-block-line! block formatted-line)
                            other-blocks)
                      context))))
@@ -97,7 +97,7 @@ with the next context."
        (if (string-prefix? ">" line)
            ;; Add line to current block
            (values (cons (add-block-line! block
-                                          `(span (@ (class "line")) ,line))
+                                          `(div (@ (class "line")) ,line))
                          other-blocks)
                    context)
            ;; Retry
@@ -124,28 +124,28 @@ with the next context."
                           ((uri-string . rest)
                            (or (and=> (string->uri uri-string)
                                       (lambda (uri)
-                                        `(span (@ (class "line"))
-                                               ,(string-trim-right pre #\<)
-                                               (a (@ (href ,uri-string))
-                                                  ,uri-string)
-                                               ,(string-join rest " "))))
-                               `(span (@ (class "line")) ,line)))))))
+                                        `(div (@ (class "line"))
+                                              ,(string-trim-right pre #\<)
+                                              (a (@ (href ,uri-string))
+                                                 ,uri-string)
+                                              ,(string-join rest " "))))
+                               `(div (@ (class "line")) ,line)))))))
                ((or (string-prefix? "Signed-off-by" line)
                     (string-prefix? "Co-authored-by" line))
-                `(span (@ (class "line commit attribution")) ,line))
+                `(div (@ (class "line commit attribution")) ,line))
                ((or (string-prefix? "From: " line)
                     (string-prefix? "Date: " line)
                     (string-prefix? "Subject: " line))
-                `(span (@ (class "line commit header")) ,line))
+                `(div (@ (class "line commit header")) ,line))
                ((or (string-prefix? "* " line)
                     (string-prefix? " * " line))
-                `(span (@ (class "line commit changelog")) ,line))
+                `(div (@ (class "line commit changelog")) ,line))
                ((string-prefix? "diff --git" line)
-                `(span (@ (class "line diff file")) ,line))
+                `(div (@ (class "line diff file")) ,line))
                ((string-prefix? "--8<---------------cut here" line)
                 "")
                (else
-                `(span (@ (class "line")) ,line)))))
+                `(div (@ (class "line")) ,line)))))
          (if (eq? new-context context)
              (values (cons (add-block-line! block formatted-line)
                            other-blocks)

  reply	other threads:[~2020-09-15  1:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02  5:16 bug#43166: The issues.guix.gnu.org is hard to read in emacs-w3m Vitaliy Shatrov
2020-09-02 17:24 ` Mark H Weaver
2020-09-02 18:18   ` Mark H Weaver
2020-09-03 16:11 ` zimoun
2020-09-05 14:17   ` Vitaliy Shatrov
2020-09-14 13:03     ` Maxim Cournoyer
2020-09-14 20:55       ` Mark H Weaver
2020-09-14 21:17         ` zimoun
2020-09-14 21:53           ` Ricardo Wurmus
2020-09-15  1:06             ` Ricardo Wurmus [this message]
2020-09-15  9:51               ` Jan Nieuwenhuizen
2020-09-15 10:13             ` Mark H Weaver
2020-09-15 10:28               ` Mark H Weaver
2021-05-20 13:35                 ` Maxim Cournoyer
2021-05-20 16:26                   ` Mark H Weaver
2021-05-20 19:23                     ` Maxim Cournoyer
2021-12-09 18:20 ` Ricardo Wurmus
2021-12-10 22:05   ` Mark H Weaver
2021-12-10 22:08     ` Ricardo Wurmus
2021-12-13  0:59   ` Mark H Weaver
2021-12-13  7:57     ` Ricardo Wurmus
2021-12-16  6:19       ` Mark H Weaver
2021-12-13  5:50   ` Jan Nieuwenhuizen

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87v9gfx2zl.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=43166@debbugs.gnu.org \
    --cc=guix.vits@disroot.org \
    --cc=maxim.cournoyer@gmail.com \
    --cc=zimon.toutoune@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).