Skip to content

Commit

Permalink
Prepend wiki if homepage and if the href doesn't start with wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonjchen committed Jul 8, 2023
1 parent f400260 commit 5a84a6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scraper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ pub fn process_html(
let new_string_href = "/m".to_owned() + &string_href;
thing.set_attr("href", &new_string_href);
} else {
// Prepend wiki if homepage
if homepage_prepend {
// Prepend wiki if homepage and if the href doesn't start with wiki
if homepage_prepend && !string_href.starts_with("wiki/") {
let new_string_href = "wiki/".to_owned() + &string_href;
thing.set_attr("href", &new_string_href);
}
Expand Down

0 comments on commit 5a84a6c

Please sign in to comment.