X-Git-Url: https://git.r.bdr.sh/rbdr/page/blobdiff_plain/394fd62bb7fd408ed2fda3e07f60294397a71652..45fbf824248215a737d5d0b52920b43b68941ad3:/src/gemini_parser.rs?ds=sidebyside diff --git a/src/gemini_parser.rs b/src/gemini_parser.rs index af1a5e0..496dc0d 100644 --- a/src/gemini_parser.rs +++ b/src/gemini_parser.rs @@ -85,13 +85,13 @@ fn get_full_line_content(line_type: &LineType, line: &str) -> String { let encoded_line = line.replace("<", "<").replace(">", ">"); match line_type { LineType::Text => format!("

{}

\n", encoded_line.trim()), - LineType::Blank => "
\n".to_string(), + LineType::Blank => "
\n".to_string(), LineType::Link => { let url = get_link_address(line); if url.starts_with("gemini:") { - format!("
{}
\n", url, get_link_content(line)) + format!("

{}

\n", url, get_link_content(line)) } else { - format!("
{}
\n", url.replace(".gmi", ".html"), get_link_content(line)) + format!("

{}

\n", url.replace(".gmi", ".html"), get_link_content(line)) } }, LineType::Heading1 => format!("

{}

\n", encoded_line[1..].trim()), @@ -119,14 +119,14 @@ fn get_heading_wrapper(heading_stack: &mut Vec, line_type: &LineType) -> Str break; } - string.push_str(""); + string.push_str(""); if open_heading == current_heading { break; } } heading_stack.push(current_heading); - string.push_str(&format!("
", current_heading)); + string.push_str(&format!("
", current_heading)); } return string; @@ -135,7 +135,7 @@ fn get_heading_wrapper(heading_stack: &mut Vec, line_type: &LineType) -> Str fn close_heading_wrapper(heading_stack: &mut Vec) -> String { let mut string = String::new(); while let Some(_open_heading) = heading_stack.pop() { - string.push_str("
"); + string.push_str(""); } return string; }