small bsky embedder @ boobsky.app - kinda mid but works - mirror of git.fomx.gay/rooot/embedthing

fix: video embeds not working if character count exceeds 256 also fixes newlines not working

Signed-off-by: rooot <hey@rooot.gay>

+8 -2
+8 -2
src/meow.rs
··· 159 159 let mut oembed_url = 160 160 Url::parse(format!("{}/api/v1/oembed", host).as_str()).unwrap(); 161 161 if let Some(ref text) = self.text { 162 - oembed_url.set_query(Some(&format!("desc={}", text))); 162 + let text = if text.len() > 256 { 163 + &text.chars().take(255).chain(['…']).collect::<String>() 164 + } else { 165 + text 166 + }; 167 + 168 + oembed_url.query_pairs_mut().append_pair("desc", text); 163 169 } else { 164 - oembed_url.set_query(Some(&format!("desc={}", "meow"))); 170 + oembed_url.query_pairs_mut().append_pair("desc", "meow"); 165 171 } 166 172 167 173 html.push_str(&format!(