diff --git a/examples/gen_sitemap.rs b/examples/gen_sitemap.rs index ae0e6d8..1c8836b 100644 --- a/examples/gen_sitemap.rs +++ b/examples/gen_sitemap.rs @@ -37,6 +37,16 @@ fn main() { ), }); + // Entity escaping + sitemap.urls.push(Url { + loc: "https://edgarluque.com/blog/test&id=''", + changefreq: Some(ChangeFreq::Never), + priority: Some(0.5), + lastmod: Some( + Utc.from_utc_datetime(&Local.ymd(2020, 12, 5).and_hms(12, 30, 0).naive_utc()), + ), + }); + let result = sitemap.into_str(); println!("{}", result); } diff --git a/src/lib.rs b/src/lib.rs index e41ffa1..559dcbb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -240,6 +240,13 @@ mod tests { lastmod: None, }); + sitemap.urls.push(Url { + loc: "https://domain.com/bb&id=''", + changefreq: None, + priority: None, + lastmod: None, + }); + sitemap.into_str(); }