Browse Source

filter out new lines

master
Julio Biason 6 years ago
parent
commit
5336e92eaf
  1. 4
      src/main.rs

4
src/main.rs

@ -108,7 +108,9 @@ fn main() {
Event::Characters(data) => {
match state.tag {
Some(CurrentTag::Title) => state.with_title(create_note_storage(&data)),
Some(CurrentTag::ResourceData) => state.with_data(data.into_bytes()),
Some(CurrentTag::ResourceData) => state.with_data(
data.into_bytes().iter().filter(|&x| *x != 13 && *x != 10).map(|&x| x).collect()
),
Some(CurrentTag::ResourceAttributesFilename) => state.with_filename(data),
_ => state
}

Loading…
Cancel
Save