Skip to content

Commit

Permalink
remove "Date:" from date component
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal <[email protected]>
  • Loading branch information
dvishal485 committed Aug 27, 2024
1 parent 8f9647f commit dcce9ac
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/scrape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,15 @@ fn clean_text(s: Node) -> String {
fn get_date(s: Node) -> Option<String> {
s.next().and_then(|date_elem| {
if date_elem.name() == Some("small") {
Some(date_elem.text().trim().to_owned())
Some(
date_elem
.text()
.trim()
.trim_start_matches("Date")
.trim_start_matches("date")
.trim_start_matches([':', ' '])
.to_owned(),
)
} else {
None
}
Expand Down

0 comments on commit dcce9ac

Please sign in to comment.