diff options
| author | Fuwn <[email protected]> | 2022-05-12 23:08:36 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-05-12 23:08:36 +0000 |
| commit | 65ee34a229c19a5e297dd188708f335b312564bb (patch) | |
| tree | dcca0896aa58c37fa4f15ffc76ca0b90fe2dd072 | |
| parent | chore(examples): write convert to file (diff) | |
| download | germ-65ee34a229c19a5e297dd188708f335b312564bb.tar.xz germ-65ee34a229c19a5e297dd188708f335b312564bb.zip | |
fix(ast): take rest of iterator as text for link
| -rw-r--r-- | examples/markdown.rs | 2 | ||||
| -rw-r--r-- | src/ast.rs | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/examples/markdown.rs b/examples/markdown.rs index a3ba61f..249c3b9 100644 --- a/examples/markdown.rs +++ b/examples/markdown.rs @@ -53,5 +53,5 @@ fn main() { germ::convert::Target::Markdown, ), ) - .expect("could not write to file"); + .expect("could not write to file"); } @@ -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; |