trim whitespace around game data
This commit is contained in:
parent
cc347dbf99
commit
b4e05cdc1b
|
@ -18,6 +18,14 @@ pub struct Game {
|
|||
|
||||
impl From<String> for Game {
|
||||
fn from(string: String) -> Game {
|
||||
let mut string = format!("{}\n\n", string.trim());
|
||||
|
||||
if string.starts_with("# BITSY VERSION") {
|
||||
string = format!("\n\n{}", string);
|
||||
}
|
||||
|
||||
let string = string;
|
||||
|
||||
// dialogues and endings can have 2+ line breaks inside, so deal with these separately
|
||||
// otherwise, everything can be split on a double line break (\n\n)
|
||||
let mut dialogues: Vec<Dialogue> = Vec::new();
|
||||
|
|
Loading…
Reference in New Issue