From 1a95ad6f5900da458b73a20aa16c230a4d36fb46 Mon Sep 17 00:00:00 2001
From: FliegendeWurst <2012gdwu+github@posteo.de>
Date: Mon, 7 Jun 2021 12:30:57 +0200
Subject: [PATCH] Always save page HTML
---
src/ilias.rs | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
diff --git a/src/ilias.rs b/src/ilias.rs
index f29131a..8102ff7 100644
--- a/src/ilias.rs
+++ b/src/ilias.rs
@@ -251,23 +251,8 @@ impl ILIAS {
let html = self.get_html(&url.url).await?;
let main_text = if let Some(el) = html.select(&IL_CONTENT_CONTAINER).next() {
- if !el
- .children()
- .flat_map(|x| x.value().as_element())
- .next()
- .map(|x| x.attr("class").unwrap_or_default().contains("ilContainerBlock"))
- .unwrap_or(false)
- && el.inner_html().len() > 40
- {
- // ^ minimum length of useful content?
- // specify a base URL for relative links
- let mut link_base = format!(r#""#, ILIAS_URL);
- link_base += &el.inner_html();
- Some(link_base)
- } else {
- // first element is the content overview => no custom text (?)
- None
- }
+ // specify a base URL for relative links
+ Some(format!(r#"{}"#, ILIAS_URL, el.inner_html()))
} else {
None
};