From 2bc8ec643072bd641434666d9c0b854e5b7a9fa7 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 21 Jun 2024 08:47:00 -0700 Subject: [PATCH] fix(ast): optional whitespace following heading markers --- Cargo.toml | 2 +- src/ast/container.rs | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4e2bed9..bcb6e42 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "germ" -version = "0.4.2" +version = "0.4.3" authors = ["Fuwn "] edition = "2021" description = "The Ultimate Gemini Toolkit." diff --git a/src/ast/container.rs b/src/ast/container.rs index c8ef58c..4f41f9d 100644 --- a/src/ast/container.rs +++ b/src/ast/container.rs @@ -216,13 +216,6 @@ impl Ast { // find out how deep it goes. let level = line.trim_start().chars().take_while(|&c| c == '#').count(); - let level = if level > 0 - && line.chars().nth(level).map_or(true, char::is_whitespace) - { - level - } else { - 0 - }; nodes.push(Node::Heading { level,