aboutsummaryrefslogtreecommitdiff
path: root/src/html.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-01-14 08:03:51 +0000
committerFuwn <[email protected]>2025-01-14 08:03:51 +0000
commit4c66642b8c579a152b46d7c6a68fadee7f1b8861 (patch)
treef840656641602335447f421d78bc14c0cade966f /src/html.rs
parentchore(crate): bump version (diff)
downloadseptember-4c66642b8c579a152b46d7c6a68fadee7f1b8861.tar.xz
september-4c66642b8c579a152b46d7c6a68fadee7f1b8861.zip
fix(html): relative url handling
Diffstat (limited to 'src/html.rs')
-rw-r--r--src/html.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/html.rs b/src/html.rs
index 64ec6ae..933ce8e 100644
--- a/src/html.rs
+++ b/src/html.rs
@@ -103,6 +103,12 @@ pub fn from_gemini(
let mut href = to.to_string();
let mut surface = false;
+ if href.starts_with("./") || href.starts_with("../") {
+ if let Ok(url) = url.join(&href) {
+ href = url.to_string();
+ }
+ }
+
if href.contains("://") && !href.starts_with("gemini://") {
surface = true;
} else if !href.contains("://") && href.contains(':') {