Correctly encode ampersand #61
1 changed files with 2 additions and 1 deletions
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
/// Escape &str for xml inclusion
|
/// Escape &str for xml inclusion
|
||||||
pub fn xml_escape(s: &str) -> String {
|
pub fn xml_escape(s: &str) -> String {
|
||||||
s.replace("<", "<")
|
s.replace("&", "&")
|
||||||
|
.replace("<", "<")
|
||||||
.replace(">", ">")
|
.replace(">", ">")
|
||||||
.replace("\"", """)
|
.replace("\"", """)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue