Browse code

filter out new lines

Julio Biason authored on 01/03/2019 10:51:03
Showing 1 changed files

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