add more tracing, make vbvg better structure
All checks were successful
CI/CD Pipeline / test (push) Successful in 1m49s
All checks were successful
CI/CD Pipeline / test (push) Successful in 1m49s
This commit is contained in:
@ -16,6 +16,7 @@
|
||||
|
||||
use std::iter::Peekable;
|
||||
|
||||
use log::trace;
|
||||
use roxmltree::{Children, Node};
|
||||
|
||||
use crate::law::Content;
|
||||
@ -39,6 +40,7 @@ impl Absatz {
|
||||
// - String: (optional) paragraph id
|
||||
// - Content: content of the paragraph
|
||||
pub(crate) fn parse_full(c: &mut Peekable<Children>) -> (Option<String>, Content) {
|
||||
trace!("Parsing absatz...");
|
||||
let absatz = AbsatzAbs::parse(c.next().unwrap());
|
||||
let par_id = absatz.gldsym;
|
||||
|
||||
@ -48,6 +50,7 @@ impl Absatz {
|
||||
// If there's a "liste" after an "absatz", the "liste" should be part of the "absatz"
|
||||
while let Some(child) = c.peek() {
|
||||
if Liste::test(child) {
|
||||
trace!("Found liste inside absatz, parsing...");
|
||||
let liste = Liste::parse_full(c).content;
|
||||
content.extend(liste);
|
||||
} else if Table::test(child) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
use std::collections::HashMap;
|
||||
use std::iter::Peekable;
|
||||
|
||||
use log::trace;
|
||||
use log::{debug, trace};
|
||||
use roxmltree::{Children, Node};
|
||||
|
||||
use crate::law::LawBuilder;
|
||||
@ -73,6 +73,7 @@ impl Abschnitt {
|
||||
builder.new_par(par_id, Content::List(contents));
|
||||
}
|
||||
|
||||
debug!("Handling post metadata");
|
||||
ret.handle_metadata(&mut c, builder);
|
||||
|
||||
// Skip all UeberschriftTitle and Absatz
|
||||
|
@ -44,12 +44,17 @@ impl Liste {
|
||||
// Parse stuff inside <liste>
|
||||
while let Some(child) = c.peek() {
|
||||
if Ziffernliste::test(child) {
|
||||
trace!("Found Ziffernliste in liste, parsing...");
|
||||
let liste = Ziffernliste::parse(&mut c);
|
||||
content.push(liste.get_content());
|
||||
} else if Schlussteil::test(child) {
|
||||
// 162 Schifffahrtsgesetz show use that a 'schlussteil' can be at the start of a list
|
||||
content.push(Content::Text(Schlussteil::parse(c.next().unwrap()).content));
|
||||
} else {
|
||||
trace!(
|
||||
"No more acceptable element in the list found: '{}'",
|
||||
child.tag_name().name()
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user