Skip to content

Commit 85fe40c

Browse files
Merge pull request #2512 from laws-africa/num-text
handle num without text
2 parents 4b12180 + fec4bde commit 85fe40c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

indigo/analysis/refs/provisions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,9 @@ def find_numbered_hier_element(self, root: Element, names: Optional[List[str]],
389389
if elem == root:
390390
continue
391391
num_elem = elem.find('a:num', {'a': ns})
392-
if num_elem is not None and self.clean_num(num_elem.text) == clean_num:
392+
# TODO: use itertext() on num_elem to allow for nested tags, but for now we assume num elements don't have nested tags
393+
# TODO: it's very rare, but we have one in the ZA Income Tax Act /akn/za/act/1962/58
394+
if num_elem is not None and self.clean_num(num_elem.text or '') == clean_num:
393395
return elem
394396

395397
def clean_num(self, num):

0 commit comments

Comments
 (0)