Fix extra slashes in post bodies

This commit is contained in:
spikecodes 2021-02-09 21:54:55 -08:00
parent 16454213cf
commit 8785bc95f5
No known key found for this signature in database
GPG Key ID: 004CECFF9B463BCB
1 changed files with 2 additions and 2 deletions

View File

@ -81,7 +81,7 @@ async fn parse_post(json: &serde_json::Value) -> Post {
id: val(post, "id"),
title: val(post, "title"),
community: val(post, "subreddit"),
body: rewrite_url(&val(post, "selftext_html")),
body: rewrite_urls(&val(post, "selftext_html")).replace("\\", ""),
author: Author {
name: val(post, "author"),
flair: Flair {
@ -151,7 +151,7 @@ async fn parse_comments(json: &serde_json::Value) -> Vec<Comment> {
let (rel_time, created) = time(unix_time);
let score = comment["data"]["score"].as_i64().unwrap_or(0);
let body = rewrite_url(&val(&comment, "body_html"));
let body = rewrite_urls(&val(&comment, "body_html"));
let replies: Vec<Comment> = if comment["data"]["replies"].is_object() {
parse_comments(&comment["data"]["replies"]).await