mirror of
https://github.com/mbilker/kbinxml-rs.git
synced 2026-09-08 10:35:32 -05:00
to_text_xml: fix attribute escaping
This commit is contained in:
@@ -53,9 +53,11 @@ impl ToTextXml for Node {
|
||||
|
||||
if let Some(attributes) = self.attributes() {
|
||||
for (key, value) in attributes {
|
||||
let value = BytesText::from_plain_str(&value);
|
||||
|
||||
elem.push_attribute(Attribute {
|
||||
key: key.as_bytes(),
|
||||
value: Cow::Borrowed(value.as_bytes()),
|
||||
value: Cow::Borrowed(value.escaped()),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,11 +61,12 @@ impl ToTextXml for NodeCollection {
|
||||
|
||||
for attribute in self.attributes() {
|
||||
let key = attribute.key()?.ok_or(KbinErrorKind::InvalidState)?.into_bytes();
|
||||
let value = attribute.value()?.to_string().into_bytes();
|
||||
let value = attribute.value()?.to_string();
|
||||
let value = BytesText::from_plain_str(&value);
|
||||
|
||||
elem.push_attribute(Attribute {
|
||||
key: &key,
|
||||
value: Cow::Owned(value),
|
||||
value: Cow::Borrowed(value.escaped()),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user