clean code, parse footer metadata
Some checks failed
CI/CD Pipeline / test (push) Has been cancelled
Some checks failed
CI/CD Pipeline / test (push) Has been cancelled
This commit is contained in:
@ -303,17 +303,17 @@ impl Absatz {
|
||||
pub(crate) fn parse(n: Node) -> Self {
|
||||
Expect::from(&n).tag("absatz");
|
||||
|
||||
if let Some(text) = n.text() {
|
||||
Self {
|
||||
content: text.into(),
|
||||
typ: n.attribute("typ").unwrap().into(),
|
||||
}
|
||||
} else {
|
||||
Self {
|
||||
content: String::new(),
|
||||
typ: n.attribute("typ").unwrap().into(),
|
||||
let typ = n.attribute("typ").unwrap().into();
|
||||
|
||||
let mut content = String::new();
|
||||
// Get text from this element + all direct childs
|
||||
for c in n.children() {
|
||||
if let Some(text) = c.text() {
|
||||
content.push_str(text);
|
||||
}
|
||||
}
|
||||
|
||||
Self { content, typ }
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user