clean code, parse footer metadata
Some checks failed
CI/CD Pipeline / test (push) Has been cancelled

This commit is contained in:
2024-02-16 10:29:30 +01:00
parent a315d69246
commit 33e10185c0
3 changed files with 31 additions and 48 deletions

View File

@ -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 }
}
}