♻️ Simple & Efficient Gemini-to-HTTP Proxy fuwn.net
proxy gemini-protocol protocol gemini http rust
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(html): selection and highlighting borders

Fuwn b0efb367 293c534b

+8 -17
+1 -1
Cargo.lock
··· 2143 2143 2144 2144 [[package]] 2145 2145 name = "september" 2146 - version = "0.2.29" 2146 + version = "0.2.30" 2147 2147 dependencies = [ 2148 2148 "actix-web", 2149 2149 "anyhow",
+1 -1
Cargo.toml
··· 2 2 3 3 [package] 4 4 name = "september" 5 - version = "0.2.29" 5 + version = "0.2.30" 6 6 authors = ["Fuwn <contact@fuwn.me>"] 7 7 edition = "2021" 8 8 description = "A simple and efficient Gemini-to-HTTP proxy."
+6 -15
src/html.rs
··· 21 21 url: &Url, 22 22 configuration: &crate::response::configuration::Configuration, 23 23 ) -> Option<(String, String)> { 24 + const GEMINI_FRAGMENT: &str = 25 + r#"<span class="gemini-fragment">=&#62; </span>"#; 24 26 let ast_tree = germ::ast::Ast::from_string( 25 27 response.content().as_ref().map_or_else(String::default, String::clone), 26 28 ); ··· 59 61 .chars() 60 62 .rev() 61 63 .collect::<String>() 62 - .replacen( 63 - &r#"<span class="gemini-fragment">=&#62;</span> "# 64 - .chars() 65 - .rev() 66 - .collect::<String>(), 67 - "", 68 - 1, 69 - ) 64 + .replacen(&GEMINI_FRAGMENT.chars().rev().collect::<String>(), "", 1) 70 65 .chars() 71 66 .rev() 72 67 .collect::<String>() ··· 95 90 } else if previous_link { 96 91 html = align_adjacent_links(&html); 97 92 98 - html.push_str(" <span style=\"opacity: 50%;\">|</span> "); 93 + html.push_str(r#" <span class="gemini-fragment">|</span> "#); 99 94 100 95 previous_link_count += 1; 101 96 } else if !previous_link && matches!(node, Node::Link { .. }) { ··· 223 218 224 219 html.push_str(&format!( 225 220 r#"{}<a href="{}">{}</a>"#, 226 - if condense_links { 227 - "" 228 - } else { 229 - r#"<span class="gemini-fragment">=&#62;</span> "# 230 - }, 221 + if condense_links { "" } else { GEMINI_FRAGMENT }, 231 222 href, 232 - safe(text.as_ref().unwrap_or(to)), 223 + safe(text.as_ref().unwrap_or(to)).trim(), 233 224 )); 234 225 } 235 226 Node::Heading { level, text } => {