♻️ 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): Escape nested list items in headings

Fuwn 596c583d 0fd7b223

+10 -3
+10 -3
src/html.rs
··· 10 10 } 11 11 12 12 fn safe(text: &str) -> String { 13 - comrak::markdown_to_html(text, &comrak::ComrakOptions::default()) 14 - .replace("<p>", "") 15 - .replace("</p>", "") 13 + let is_ordered_list = text.starts_with(|c: char| c.is_ascii_digit()) 14 + && text.get(1..3) == Some(". "); 15 + 16 + if is_ordered_list { 17 + text.to_string() 18 + } else { 19 + comrak::markdown_to_html(text, &comrak::ComrakOptions::default()) 20 + .replace("<p>", "") 21 + .replace("</p>", "") 22 + } 16 23 } 17 24 18 25 #[allow(clippy::too_many_lines, clippy::cognitive_complexity)]