fix segments_from_str; version bump

This commit is contained in:
2020-11-06 15:39:43 +00:00
parent e992e41635
commit b9415ade9e
3 changed files with 5 additions and 5 deletions

View File

@@ -108,11 +108,11 @@ fn transform_line_endings(input: String, mode: TransformMode) -> String {
String::from_utf8(output.into_inner()).unwrap()
}
fn segments_from_string(string: String) -> Vec<String> {
fn segments_from_str(str: &str) -> Vec<String> {
// this is pretty weird but a dialogue can just have an empty line followed by a name
// however, on entering two empty lines, dialogue will be wrapped in triple quotation marks
// so, handle this here
let string = string.replace("\n\nNAME", "\n\"\"\"\n\"\"\"\nNAME");
let string = str.replace("\n\nNAME", "\n\"\"\"\n\"\"\"\nNAME");
let mut output:Vec<String> = Vec::new();
// are we inside `"""\n...\n"""`? if so, ignore empty lines