From fb21d3eece57930d55a6ad022a4c6d4f13cdf368 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 30 Aug 2022 21:06:44 +0200 Subject: [PATCH] fix for 2022-2023 semester 1 --- src/timetable.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/timetable.rs b/src/timetable.rs index 4cbaa5b..a36341d 100644 --- a/src/timetable.rs +++ b/src/timetable.rs @@ -50,6 +50,7 @@ pub async fn timetable( // For each days let mut timetable = Vec::new(); + let span_regex = Regex::new(r"").unwrap(); for day in raw_timetable_values.select(&sel_tr) { let mut courses_vec = Vec::new(); let mut location_tracker = 0; @@ -60,12 +61,9 @@ pub async fn timetable( } else { courses_vec.push(Some(models::Course { name: match course.select(&sel_em).next() { - Some(value) => value.inner_html(), - None => course - .inner_html() - .split("
") - .next() - .unwrap() + Some(value) => span_regex.replace(&value.inner_html(), " ").to_string(), + None => span_regex + .replace(course.inner_html().split("
").next().unwrap(), " ") .to_string(), }, professor: match course