Browse Source

better blockquote from reddit.

Jason Schwarzenberger 6 months ago
parent
commit
a7a1170b66
2 changed files with 17 additions and 4 deletions
  1. 2 2
      apiserver/feeds/reddit.py
  2. 15 2
      webapp/static/global.css

+ 2 - 2
apiserver/feeds/reddit.py

@@ -51,7 +51,7 @@ def comment(i):
     c['author'] = i.author.name if i.author else '[Deleted]'
     c['score'] = i.score
     c['date'] = i.created_utc
-    c['text'] = render_md(clean(i.body))
+    c['text'] = clean(render_md(i.body))
     c['comments'] = [comment(j) for j in i.replies]
     c['comments'] = list(filter(bool, c['comments']))
     return c
@@ -77,7 +77,7 @@ def story(ref):
             return False
 
         if r.selftext:
-            s['text'] = render_md(clean(r.selftext))
+            s['text'] = clean(render_md(r.selftext))
 
         return s
 

+ 15 - 2
webapp/static/global.css

@@ -22,6 +22,14 @@ code {
   padding: 0.2em 0.4em;
   border-radius: 2px;
 }
+blockquote {
+  padding: 0.75rem;
+  margin: 0 3rem;
+  font-style: oblique;
+  background: #fafafa;
+  border-left: solid 0.25rem #ddd;
+  border-right: solid 0.25rem transparent;
+}
 
 pre {
   max-width: 100%;
@@ -34,7 +42,12 @@ body.dark-mode {
 }
 
 body.dark-mode pre,
-body.dark-mode code {
+body.dark-mode code,
+body.dark-mode blockquote {
   color: #aaa;
-  background-color: #0f0f0f;
+  background-color: #111;
+}
+body.dark-mode blockquote {
+  border-left: solid 0.25rem #333;
+  border-right: solid 0.25rem transparent;
 }