diff options
| author | Fuwn <[email protected]> | 2025-01-14 08:03:51 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-01-14 08:03:51 +0000 |
| commit | 559d9f402d610aaf90d8e72aa7f9ead87157d9f1 (patch) | |
| tree | f840656641602335447f421d78bc14c0cade966f /src/html.rs | |
| parent | chore(crate): bump version (diff) | |
| download | september-559d9f402d610aaf90d8e72aa7f9ead87157d9f1.tar.xz september-559d9f402d610aaf90d8e72aa7f9ead87157d9f1.zip | |
fix(html): relative url handling
Diffstat (limited to 'src/html.rs')
| -rw-r--r-- | src/html.rs | 6 |
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(':') { |