mirror of
https://github.com/edg-l/sitewriter.git
synced 2024-09-19 09:12:24 +00:00
add entity escaping to the example
This commit is contained in:
parent
4d3dbedd14
commit
40713ae38b
|
@ -37,6 +37,16 @@ fn main() {
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Entity escaping
|
||||||
|
sitemap.urls.push(Url {
|
||||||
|
loc: "https://edgarluque.com/blog/test&id='<test>'",
|
||||||
|
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();
|
let result = sitemap.into_str();
|
||||||
println!("{}", result);
|
println!("{}", result);
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,6 +240,13 @@ mod tests {
|
||||||
lastmod: None,
|
lastmod: None,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
sitemap.urls.push(Url {
|
||||||
|
loc: "https://domain.com/bb&id='<test>'",
|
||||||
|
changefreq: None,
|
||||||
|
priority: None,
|
||||||
|
lastmod: None,
|
||||||
|
});
|
||||||
|
|
||||||
sitemap.into_str();
|
sitemap.into_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue