Fix #59 (& issue)

This commit is contained in:
Alex Auvolat 2021-04-27 23:10:43 +02:00
parent e01f74e763
commit 642186c530
No known key found for this signature in database
GPG Key ID: EDABF9711E244EB1

View File

@ -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("<", "&lt;") s.replace("&", "&amp;")
.replace("<", "&lt;")
.replace(">", "&gt;") .replace(">", "&gt;")
.replace("\"", "&quot;") .replace("\"", "&quot;")
} }