aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gemini_to_html.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gemini_to_html.rs b/src/gemini_to_html.rs
index 7e0d6e2..777381a 100644
--- a/src/gemini_to_html.rs
+++ b/src/gemini_to_html.rs
@@ -36,6 +36,7 @@ fn link_from_host_href(url: &Url, href: &str) -> String {
)
}
+#[allow(clippy::too_many_lines)]
pub fn gemini_to_html(
response: &gmi::protocol::Response,
url: &Url,
@@ -56,7 +57,9 @@ pub fn gemini_to_html(
} => {
let mut href = to.clone();
- if href.starts_with('/') || !href.contains("://") {
+ if !href.starts_with("gemini://") && !href.starts_with('/') {
+ href = format!("./{}", href);
+ } else if href.starts_with('/') || !href.contains("://") {
href = link_from_host_href(url, &href);
}