aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-06-20 10:07:38 +0000
committerFuwn <[email protected]>2023-06-20 10:07:38 +0000
commit5c2fbd45c082c4a6979a16d52a6be82393642d97 (patch)
tree2dfe1ad5770542cf2d338344f22c3a1d481182e9
parentfmt: update rustfmt.toml (diff)
downloadgerm-0.3.10.tar.xz
germ-0.3.10.zip
fix(ast): non-latin characters interpreted as whitespacev0.3.10
-rw-r--r--Cargo.toml2
-rw-r--r--src/ast/container.rs10
2 files changed, 8 insertions, 4 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 681f515..d54df13 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,7 +2,7 @@
[package]
name = "germ"
-version = "0.3.9"
+version = "0.3.10"
authors = ["Fuwn <[email protected]>"]
edition = "2021"
description = "The Ultimate Gemini Toolkit."
diff --git a/src/ast/container.rs b/src/ast/container.rs
index 0e3337d..d3f6f5a 100644
--- a/src/ast/container.rs
+++ b/src/ast/container.rs
@@ -251,9 +251,13 @@ impl Ast {
}
}
"" if !*in_preformatted => {
- // If the line has nothing on it, it is a whitespace line, as long as
- // we aren't in a preformatted line context.
- nodes.push(Node::Whitespace);
+ if line.is_empty() {
+ // If the line has nothing on it, it is a whitespace line, as long
+ // as we aren't in a preformatted line context.
+ nodes.push(Node::Whitespace);
+ } else {
+ nodes.push(Node::Text(line.to_string()));
+ }
break;
}