Fix xref links
This commit is contained in:
@@ -74,9 +74,7 @@ def extract_xrefs(el: lxml.etree.Element, language: Language) -> list[CrossRefer
|
||||
}
|
||||
for key, pattern in patterns.items():
|
||||
matches = re.finditer(pattern, text, flags=re.IGNORECASE)
|
||||
print(f"Pattern: {pattern}")
|
||||
for match in matches:
|
||||
print(f"Match: {match.group(0)}")
|
||||
crossref_id = (
|
||||
match.group("art_num") if key == "article" else match.group("annex_num")
|
||||
)
|
||||
@@ -158,8 +156,6 @@ class FormexArticleConverter:
|
||||
if not is_title and not element.getchildren():
|
||||
# Cross-references should be treated at the deepest level
|
||||
xrefs = extract_xrefs(element, self.language)
|
||||
print("Extracted cross-references: ", xrefs)
|
||||
|
||||
for xref in xrefs:
|
||||
# Replace the cross-reference text with a link
|
||||
result = self._replace_xref(result, xref)
|
||||
|
||||
Reference in New Issue
Block a user