-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Newlines in attributes are lost #115
Labels
Comments
This is indeed looks like a bug. |
@idubrov #[test]
fn test_newlines_in_attribute_should_not_be_lost() {
let mut r = Reader::from_str("<tag1 attr1='line 1\nline 2'></tag1>");
r.trim_text(true);
let mut buf = Vec::new();
match r.read_event(&mut buf) {
Ok(Event::Start(ref e)) => match e.name() {
b"tag1" => {
let v = e.attributes().map(|a| a.unwrap().value).collect::<Vec<_>>();
assert_eq!(v[0].clone().into_owned(), b"line 1\nline 2");
}
_ => (),
},
_ => (),
}
} |
Fixed long time ago. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Newlines in attributes are not encoded into XML escape sequence and are lost or re-parsing.
(https://stackoverflow.com/questions/2004386/how-to-save-newlines-in-xml-attribute)
The text was updated successfully, but these errors were encountered: