diff options
| author | Fuwn <[email protected]> | 2022-04-15 08:36:49 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-04-15 08:36:49 +0000 |
| commit | 8170a1d1920981feaa2181a45ec53da9886d313a (patch) | |
| tree | 2bb9c4803f7130996e6b8c86a28f51b85d7fe4a5 | |
| parent | docs(cargo): fix readme location (diff) | |
| download | september-8170a1d1920981feaa2181a45ec53da9886d313a.tar.xz september-8170a1d1920981feaa2181a45ec53da9886d313a.zip | |
fix(gemini_to_html): first list item clipping0.1.1
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | src/main.rs | 17 |
2 files changed, 10 insertions, 9 deletions
@@ -2,7 +2,7 @@ [package] name = "september" -version = "0.1.0" +version = "0.1.1" authors = ["Fuwn <[email protected]>"] edition = "2021" description = "A simple and efficient Gemini-to-HTTP proxy." diff --git a/src/main.rs b/src/main.rs index 7925b57..bf566a2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -131,16 +131,17 @@ fn gemini_to_html( response_string.push('\n'); } // Convert lists - "*" => - if in_list { - response_string.push_str(&format!( - "<li>{}</li>\n", - line.replace('*', "").trim_start() - )); - } else { + "*" => { + if !in_list { in_list = true; response_string.push_str("<ul>\n"); - }, + } + + response_string.push_str(&format!( + "<li>{}</li>\n", + line.replace('*', "").trim_start() + )); + } // Convert headings "#" => { if in_list { |