allow empty text
This commit is contained in:
parent
a94d23bc2c
commit
8e9192ce98
@ -75,18 +75,18 @@ fn parse_footprint(
|
|||||||
.attr("content")?;
|
.attr("content")?;
|
||||||
let format = format_description::parse("[year]-[month]-[day]").ok()?;
|
let format = format_description::parse("[year]-[month]-[day]").ok()?;
|
||||||
let date = Date::parse(date, &format).ok()?;
|
let date = Date::parse(date, &format).ok()?;
|
||||||
let text = footprint_el
|
|
||||||
.select(text_selector)
|
|
||||||
.next()?
|
|
||||||
.text()
|
|
||||||
.next()?
|
|
||||||
.to_string();
|
|
||||||
|
|
||||||
let text = if let Some(text_rest) = footprint_el.select(text_rest_selector).next() {
|
let text = if let Some(text) = footprint_el.select(text_selector).next() {
|
||||||
|
let text = text.text().next()?.to_string();
|
||||||
|
|
||||||
|
if let Some(text_rest) = footprint_el.select(text_rest_selector).next() {
|
||||||
format!("{}{}", text, text_rest.text().next()?)
|
format!("{}{}", text, text_rest.text().next()?)
|
||||||
} else {
|
} else {
|
||||||
text
|
text
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
"".to_string()
|
||||||
|
}
|
||||||
.trim()
|
.trim()
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user