Compare commits
	
		
			2 Commits
		
	
	
		
			172215abaa
			...
			4540cedde6
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 4540cedde6 | |||
| 1b49ba1314 | 
							
								
								
									
										32
									
								
								data/configs/ug.toml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								data/configs/ug.toml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
			
		||||
[law]
 | 
			
		||||
id = 20002128
 | 
			
		||||
name = "Universitätsgesetz 2002"
 | 
			
		||||
 | 
			
		||||
[[law.classifiers]]
 | 
			
		||||
name = "Teil"
 | 
			
		||||
is_root = true
 | 
			
		||||
match_function = "contains"
 | 
			
		||||
 | 
			
		||||
[[law.classifiers]]
 | 
			
		||||
name = " Abschnitt"
 | 
			
		||||
is_root = false
 | 
			
		||||
match_function = "contains"
 | 
			
		||||
 | 
			
		||||
[[law.classifiers]]
 | 
			
		||||
name = "Unterabschnitt"
 | 
			
		||||
is_root = false
 | 
			
		||||
match_function = "contains"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
[parser]
 | 
			
		||||
remove_strings = [
 | 
			
		||||
	"<n>", "</n>",
 | 
			
		||||
	"""<abstand ct="text" halign="l" />""",
 | 
			
		||||
	"<br />",
 | 
			
		||||
	"<i>", "</i>",
 | 
			
		||||
	"<u>", "</u>"
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
[[parser.replace_rules]]
 | 
			
		||||
find = "<gdash />" # Should be at the same level as the other "Theil"e
 | 
			
		||||
replace_with = "-"
 | 
			
		||||
@@ -297,15 +297,19 @@ pub(crate) struct Td {
 | 
			
		||||
    absatz: Absatz,
 | 
			
		||||
}
 | 
			
		||||
impl Td {
 | 
			
		||||
    pub(crate) fn parse(n: &Node) -> Self {
 | 
			
		||||
    /// Returns `None` if td doesn't contain anything. used e.g. in § 71b to style table...
 | 
			
		||||
    pub(crate) fn parse(n: &Node) -> Option<Self> {
 | 
			
		||||
        Expect::from(n).tag("td");
 | 
			
		||||
 | 
			
		||||
        let mut c = n.children();
 | 
			
		||||
        let absatz = Absatz::parse(c.next().unwrap());
 | 
			
		||||
 | 
			
		||||
        let Some(next) = c.next() else { return None };
 | 
			
		||||
 | 
			
		||||
        let absatz = Absatz::parse(next);
 | 
			
		||||
 | 
			
		||||
        Expect::empty(c.next());
 | 
			
		||||
 | 
			
		||||
        Self { absatz }
 | 
			
		||||
        Some(Self { absatz })
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -320,7 +324,9 @@ impl Tr {
 | 
			
		||||
        let mut tds = Vec::new();
 | 
			
		||||
 | 
			
		||||
        for child in n.children() {
 | 
			
		||||
            tds.push(Td::parse(&child));
 | 
			
		||||
            if let Some(td) = Td::parse(&child) {
 | 
			
		||||
                tds.push(td);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        Self { tds }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user