Skip to content

Commit

Permalink
sanitize identifiers found inside of documents as well
Browse files Browse the repository at this point in the history
  • Loading branch information
staffanm committed Feb 5, 2018
1 parent 5a4d0d9 commit 2f0025c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions ferenda/sources/legal/se/offtryck.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,12 +637,15 @@ def helper(node, meta):
if not identifier_found and hasattr(self, 're_basefile_lax'):
m = self.re_basefile_lax.search(str_element)
if m:
_check_differing(
d,
self.ns['dcterms'].identifier,
"Prop. " +
m.group(1))
identifier_found = True
try:
# even identifiers inside of the document can be irregular
new_identifier = "Prop. " + m.group(1)
identifier = self.sanitize_identifier(new_identifier)
_check_differing(d, DCTERMS.identifier, identifier)
identifier_found = True
except ValueError:
self.log.warning("%s: Irregular identifier %s in document" %
(doc.basefile, m.group(1)))

# dcterms:title FIXME: The fontsize comparison should be
# done with respect to the resulting metrics (which we
Expand Down

0 comments on commit 2f0025c

Please sign in to comment.