summaryrefslogtreecommitdiffstats
path: root/src/poem/recite.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/poem/recite.rs')
-rw-r--r--src/poem/recite.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/poem/recite.rs b/src/poem/recite.rs
index 9a425e8..a067f3d 100644
--- a/src/poem/recite.rs
+++ b/src/poem/recite.rs
@@ -66,6 +66,9 @@ impl Reciteable for Poem {
None => {}
};
+ // Check if verse is a builtin
+ let index = anthology::lookup(&verse.verb());
+
// Run interal poems
let v = verse.clone();
let mut new_stanza = None;
@@ -98,7 +101,7 @@ impl Reciteable for Poem {
None => break, // TODO: Return an error
};
let out = poem.recite(env, Some(false))?;
- if out.contains("\n") {
+ if out.contains("\n") && index.is_none() {
let mut out = out.split("\n");
let next = out.next().unwrap_or("").trim();
*wordp = wordp.replacen("\x0b", next, 1).to_string();
@@ -118,6 +121,7 @@ impl Reciteable for Poem {
} else {
*wordp = wordp.replacen("\x0b", out.as_str(), 1).to_string();
}
+ *wordp = wordp.replacen("\x0b", out.as_str(), 1).to_string();
}
j += 1;
}
@@ -129,10 +133,9 @@ impl Reciteable for Poem {
verse.stanza.append(&mut stanza);
}
None => {}
- }
+ };
// Incant the verse if it's a built-in
- let index = anthology::lookup(&verse.verb());
let status = if index.is_some() {
anthology::incant(&verse, index.unwrap(), env)
} else {