emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] main 8d849e591e 1/2: * html/layout.css: Fix rendering of markdown


From: Stefan Monnier
Subject: [elpa] main 8d849e591e 1/2: * html/layout.css: Fix rendering of markdown code blocks
Date: Thu, 27 Oct 2022 23:05:00 -0400 (EDT)

branch: main
commit 8d849e591e3bf2deacffe384f104cd2ba4ebd280
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * html/layout.css: Fix rendering of markdown code blocks
---
 html/layout.css | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/html/layout.css b/html/layout.css
index 807cf1b4e6..df08da8925 100644
--- a/html/layout.css
+++ b/html/layout.css
@@ -112,6 +112,11 @@ a:hover {
   text-decoration: underline;
 }
 
+/* FIXME: This is meant for inline `code` but also matches block `code` :-(
+   I tried to use `:not(pre) code` so that it applies to all `code`
+   except those immediately within a `pre` but AFAICT it then did not match
+   anything at all.  So instead I use a separate rule for `pre code` which
+   overrides some of these settings.  */
 tt, code {
   font-family: "Fira Mono", monospace;
   background-color: rgb(238, 238, 238);
@@ -121,13 +126,24 @@ tt, code {
   white-space: nowrap;
 }
 
+/* FIXME: This overrides the above settings for the non-inline multiline
+   code blocks.  Important for Markdown rendered files which use
+   <pre><code>...</code></pre> for multiline code blocks.  */
+pre code {
+  background: #fafafa;
+  border: 0px solid;
+  white-space: pre;
+  padding: 0px;
+}
+
 pre {
   font-family: "Fira Mono", monospace;
   font-size: 14px;
   background: #fafafa;
   padding: 1em;
-  border: 1px solid #dadada;
+  border: 0px solid;
   overflow-y: auto;
+  white-space: pre;
 }
 
 pre .kw {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]