diff --git a/src/utils.rs b/src/utils.rs index 2c74783..0bcad3c 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -251,11 +251,8 @@ impl Post { // Determine the type of media along with the media URL let (post_type, media, gallery) = Media::parse(data).await; - // selftext is set for text posts when browsing a (sub)reddit. - // Do NOT use selftext_html, because we truncate this content - // in the template code, and using selftext_html might result - // in truncated html. - let mut body = rewrite_urls(&val(post, "selftext")); + // selftext_html is set for text posts when browsing. + let mut body = rewrite_urls(&val(post, "selftext_html")); if body == "" { body = rewrite_urls(&val(post, "body_html")) } diff --git a/static/style.css b/static/style.css index 2d3bf24..67a694d 100644 --- a/static/style.css +++ b/static/style.css @@ -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; } diff --git a/templates/utils.html b/templates/utils.html index e5ba8f8..efd591e 100644 --- a/templates/utils.html +++ b/templates/utils.html @@ -132,7 +132,7 @@
{{ post.score.0 }} Upvotes
- {{ post.body|truncate(1000) }} + {{ post.body }}
{{ post.comments.0 }} comments