aboutsummaryrefslogtreecommitdiff
path: root/src/ast.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-05-12 23:08:36 +0000
committerFuwn <[email protected]>2022-05-12 23:08:36 +0000
commit65ee34a229c19a5e297dd188708f335b312564bb (patch)
treedcca0896aa58c37fa4f15ffc76ca0b90fe2dd072 /src/ast.rs
parentchore(examples): write convert to file (diff)
downloadgerm-65ee34a229c19a5e297dd188708f335b312564bb.tar.xz
germ-65ee34a229c19a5e297dd188708f335b312564bb.zip
fix(ast): take rest of iterator as text for link
Diffstat (limited to 'src/ast.rs')
-rw-r--r--src/ast.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ast.rs b/src/ast.rs
index 69ad123..8f8495e 100644
--- a/src/ast.rs
+++ b/src/ast.rs
@@ -231,7 +231,15 @@ fn evaluate(
nodes.push(Node::Link {
to: split.next().expect("no location in link"),
- text: split.next(),
+ text: {
+ let rest = split.collect::<Vec<String>>().join(" ");
+
+ if rest.is_empty() {
+ None
+ } else {
+ Some(rest)
+ }
+ },
});
break;