Skip to content

Commit

Permalink
fix(xmlupload): allow external link in text value (DEV-3054) (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Dec 5, 2023
1 parent a0d5776 commit 08f7b93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/dsp_tools/commands/xmlupload/read_validate_xml_file.py
Expand Up @@ -81,6 +81,7 @@ def _check_if_salsah_targets_exist(root: etree._Element) -> list[str]:
link_values = [x for x in root.iter() if x.tag == "a"]
resource_ids = [x.attrib["id"] for x in root.iter() if x.tag == "resource"]
invalid_link_values = [x for x in link_values if regex.sub(r"IRI:|:IRI", "", x.attrib["href"]) not in resource_ids]
invalid_link_values = [x for x in invalid_link_values if x.attrib.get("class") == "salsah-link"]
invalid_link_values = [x for x in invalid_link_values if not is_resource_iri(x.attrib["href"])]
errors = []
for inv in invalid_link_values:
Expand Down
1 change: 1 addition & 0 deletions testdata/xml-data/test-data-systematic.xml
Expand Up @@ -101,6 +101,7 @@
<a class="salsah-link" href="IRI:test_thing_2:IRI">test_thing_2</a>
<a class="salsah-link" href="http://rdfh.ch/4123/DiAmYQzQSzC7cdTo6OJMYA">test_thing_with_iri_1</a>
</text>
<text encoding="xml">Text with an external link: <a href="https://www.google.com/">Google</a></text>
</text-prop>
<uri-prop name=":hasUri">
<uri permissions="prop-default">https://dasch.swiss</uri>
Expand Down

0 comments on commit 08f7b93

Please sign in to comment.