format-flowed: make quotes round-trip

This commit is contained in:
link2xt
2022-12-28 23:03:38 +00:00
parent ecc7758788
commit 8e65e794bc
4 changed files with 62 additions and 25 deletions

View File

@@ -10,10 +10,7 @@ fn round_trip(input: &str) -> String {
fn main() {
check!().for_each(|data: &[u8]| {
if let Ok(input) = std::str::from_utf8(data.into()) {
let mut input = input.to_string();
// Only consider inputs that don't contain quotes.
input.retain(|c| c != '>');
let input = input.trim().to_string();
// Only consider inputs that are the result of unformatting format=flowed text.
// At least this means that lines don't contain any trailing whitespace.