X-Git-Url: https://git.r.bdr.sh/rbdr/gema_texto/blobdiff_plain/26ab94e7d00cfb920d14b9a6e64dfe16dc120a95..5f7e1e310aafc765684463d3ae00359c652cd751:/src/html_renderer.rs?ds=sidebyside diff --git a/src/html_renderer.rs b/src/html_renderer.rs index e513533..503337b 100644 --- a/src/html_renderer.rs +++ b/src/html_renderer.rs @@ -99,8 +99,14 @@ fn line_content(line: &GeminiLine) -> String { match line { GeminiLine::Text(content, false) => format!("
{content}
"), GeminiLine::Link(url, text) => { - let display = if text.is_empty() { url } else { text }; - format!("") + let processed_url; + if !url.starts_with("gemini:") && url.ends_with(".gmi") { + processed_url = url.replace(".gmi", ".html"); + } else { + processed_url = url.to_string(); + } + let display = if text.is_empty() { &processed_url } else { text }; + format!("") } GeminiLine::Heading(level, content) => format!("