Render markdown correctly in text post previews by using selftext_html. (#335)

* Render markdown correctly in text post previews by using selftext_html.

I was mistakenly under the impression that we somehow render markdown ourselves, but turns out we just take whatever HTML reddit gives us, and we also need to do this for text previews.

Use CSS to limit the size of the previews instead of truncating in the template.

Fix table CSS.

* Fix post_body padding and trim post_previews

Co-authored-by: spikecodes <19519553+spikecodes@users.noreply.github.com>
This commit is contained in:
mikupls 2021-11-22 00:17:52 +01:00 committed by GitHub
parent 2ef7957a66
commit 768820cd4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 8 deletions

View file

@ -838,14 +838,16 @@ a.search_subreddit:hover {
.post_body {
opacity: 0.9;
font-weight: normal;
padding: 5px 15px;
padding: 5px 15px 5px 12px;
grid-area: post_body;
width: calc(100% - 30px);
}
/* Used only for text post preview */
.post_preview {
mask-image: linear-gradient(180deg,#000 60%,transparent);
opacity: 0.8;
max-height: 250px;
}
.post_footer {
@ -1223,7 +1225,6 @@ input[type="submit"] {
.md table {
margin: 5px;
display: block;
overflow-x: auto;
}