Replace newlines with spaces

This commit is contained in:
Yash Karandikar 2022-01-16 18:58:06 -06:00
parent be2cca1807
commit 704f5ec0d6
Signed by: karx
GPG key ID: A794DA2529474BA5

View file

@ -149,6 +149,9 @@ impl EventHandler for Handler {
}
}
computed = computed.replace('\n', " ");
computed = computed.replace("\r\n", " "); // just in case
let chars = computed.as_bytes().iter().map(|&b| b as char).collect::<Vec<char>>();
let chunks = chars.chunks(content_limit);