aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-08-03 18:20:48 +0000
committerFuwn <[email protected]>2024-08-03 18:20:48 +0000
commitf16682d9561abcec61471fa157be18d9fcc6af31 (patch)
tree75b1805c8021c680d25c41dc0af0618384da08a8 /src
parentfeat: derive all for public types (diff)
downloadgerm-f16682d9561abcec61471fa157be18d9fcc6af31.tar.xz
germ-f16682d9561abcec61471fa157be18d9fcc6af31.zip
feat(ast): arbitrary heading depth generationv0.4.5
Diffstat (limited to 'src')
-rw-r--r--src/ast/container.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/ast/container.rs b/src/ast/container.rs
index c8f9ecf..b255ec7 100644
--- a/src/ast/container.rs
+++ b/src/ast/container.rs
@@ -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