Skip to content

Commit

Permalink
feat(ast): arbitrary heading depth generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuwn committed Aug 3, 2024
1 parent fd9060a commit 71da187
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[package]
name = "germ"
version = "0.4.4"
version = "0.4.5"
authors = ["Fuwn <[email protected]>"]
edition = "2021"
description = "The Ultimate Gemini Toolkit."
Expand Down
12 changes: 2 additions & 10 deletions src/ast/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,8 @@ impl Ast {
to,
text.clone().map_or_else(String::new, |text| format!(" {text}")),
)),
Node::Heading { level, text } => gemtext.push_str(&format!(
"{} {}\n",
match level {
1 => "#",
2 => "##",
3 => "###",
_ => "",
},
text
)),
Node::Heading { level, text } =>
gemtext.push_str(&format!("{} {}\n", "#".repeat(*level), text)),
Node::List(items) => gemtext.push_str(&format!(
"{}\n",
items
Expand Down

0 comments on commit 71da187

Please sign in to comment.