match line {
s if s.starts_with("###") => GeminiLine::Heading(3, s[3..].to_string()),
s if s.starts_with("##") => GeminiLine::Heading(2, s[2..].to_string()),
match line {
s if s.starts_with("###") => GeminiLine::Heading(3, s[3..].to_string()),
s if s.starts_with("##") => GeminiLine::Heading(2, s[2..].to_string()),
s if s.starts_with("=>") => {
let content = s[2..].trim();
match content.split_once(char::is_whitespace) {
s if s.starts_with("=>") => {
let content = s[2..].trim();
match content.split_once(char::is_whitespace) {
s if s.starts_with("```") => GeminiLine::PreformattedToggle(true, s[3..].to_string()),
_ => GeminiLine::Text(line.to_string(), false),
}
s if s.starts_with("```") => GeminiLine::PreformattedToggle(true, s[3..].to_string()),
_ => GeminiLine::Text(line.to_string(), false),
}
assert_eq!(parse_line(" "), GeminiLine::Text(" ".to_string(), false));
assert_eq!(parse_line(" "), GeminiLine::Text(" ".to_string(), false));
}
assert_eq!(parse_line(" "), GeminiLine::Text(" ".to_string(), false));
assert_eq!(parse_line(" "), GeminiLine::Text(" ".to_string(), false));
}
GeminiLine::Text("=> https://example.com Link text".to_string(), true),
GeminiLine::Text("* List item".to_string(), true),
GeminiLine::Text(">Quote".to_string(), true),
GeminiLine::Text("=> https://example.com Link text".to_string(), true),
GeminiLine::Text("* List item".to_string(), true),
GeminiLine::Text(">Quote".to_string(), true),