say when there is no text in a footprint

This commit is contained in:
Sebastian Hugentobler 2023-11-18 10:12:30 +01:00
parent 8e9192ce98
commit b1e3218eb3
Signed by: shu
GPG Key ID: BB32CF3CA052C2F0

View File

@ -42,10 +42,17 @@ const ISO8601_DATE: u128 = iso8601::Config::DEFAULT
impl Footprint {
pub fn into_rss_item(self, root_url: &str) -> Item {
let text = if String::is_empty(&self.text) {
"No description"
} else {
&self.text
};
// injection, I know
let desc = format!(
"{} <br /><br /> --- <br /><br /> from {}",
self.text,
page_url(root_url, self.page)
"{} <br /><br /> --- <br /><br /> from <a href=\"{}\">page {}</a>",
text,
page_url(root_url, self.page),
self.page
);
ItemBuilder::default()
.title(Some(self.title))