mirror of
https://github.com/redlib-org/redlib.git
synced 2025-06-07 15:17:47 +00:00
Fix backslash url rewriting and add tests for rewrite_urls. (#461)
* Fix backslash url rewriting. Add test for rewrite_urls. Fixes #281. * Update to v0.22.5 Co-authored-by: spikecodes <19519553+spikecodes@users.noreply.github.com>
This commit is contained in:
parent
ed11135af8
commit
eb6c5e5e1e
5 changed files with 22 additions and 8 deletions
|
@ -336,10 +336,10 @@ pub async fn sidebar(req: Request<Body>) -> Result<Response<Body>, String> {
|
|||
match json(path, quarantined).await {
|
||||
// If success, receive JSON in response
|
||||
Ok(response) => template(WikiTemplate {
|
||||
wiki: rewrite_urls(&val(&response, "description_html").replace("\\", "")),
|
||||
wiki: rewrite_urls(&val(&response, "description_html")),
|
||||
// wiki: format!(
|
||||
// "{}<hr><h1>Moderators</h1><br><ul>{}</ul>",
|
||||
// rewrite_urls(&val(&response, "description_html").replace("\\", "")),
|
||||
// rewrite_urls(&val(&response, "description_html"),
|
||||
// moderators(&sub, quarantined).await.unwrap_or(vec!["Could not fetch moderators".to_string()]).join(""),
|
||||
// ),
|
||||
sub,
|
||||
|
@ -411,7 +411,7 @@ async fn subreddit(sub: &str, quarantined: bool) -> Result<Subreddit, String> {
|
|||
name: esc!(&res, "display_name"),
|
||||
title: esc!(&res, "title"),
|
||||
description: esc!(&res, "public_description"),
|
||||
info: rewrite_urls(&val(&res, "description_html").replace("\\", "")),
|
||||
info: rewrite_urls(&val(&res, "description_html")),
|
||||
// moderators: moderators_list(sub, quarantined).await.unwrap_or_default(),
|
||||
icon: format_url(&icon),
|
||||
members: format_num(members),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue