openlibhums/janeway

<ext-link> tagged within <ref> results in duplicated hyperlinks

Opened this issue · 0 comments

Describe the bug
URLs tagged with <ext-link> within <ref> (most frequently DOIs) are being duplicated in the rendered HTML version of the article. Specifically, it seems that Janeway is rendering one instance of the <ext-link> where it was originally tagged, and then duplicating the link at the very end of the <ref>. I deduced this because a reference ending in two URLs listed both of the URLs as tagged, in the correct order and with a period and space between them, but then both URLs are immediately repeated (without any spaces) after the second URL - see example 1 in the Screenshots section below. I also found a handful of examples where plain text appears after the <ext-link> within the tagged <ref>; in each of those cases the link is rendered where it was tagged, followed by the plain text, as expected, and then the duplicate link appeared at the end - See example 2 in Screenshots below.

On Discord, Andy speculated that "I think we're outputing the text inside the <ext-link> tags and extraging the xlink:href and displaying that. The text inside the <ext-link> should be used for the inside of the <a> it shouldn't be duplicated." Hypothetically this could be worked around by wrapping the URL in plain <ext-link> tags without any attributes (specifically xlink:href) but I'm not sure if that would continue to work properly after the fix is implemented. Andy also suggested only using the attributes and leaving the <ext-link> tag itself empty. However, I have a suspicion that the link that appears in the correct location is the text wrapped in <ext-link>, and that the link duplicated at the end is the extracted href, so I'm not sure an empty <ext-link> would be an appropriate workaround if we want the text to appear where it's meant to appear.

Janeway version
1.5.1, and (at Andy's suggestion) switching back to 1.4.3 fixed the problem.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://journals.publishing.umich.edu/sdi/article/id/5296/
  2. Click on "References"
  3. Note that every URL in the References section is duplicated

Expected behavior
The text inside the <ext-link> should be visibly displayed as hyperlinked text, while the href should be used as the destination of that hyperlink (and not visibly displayed)

Screenshots
Example 1:
<ref id="R97"><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Wu</surname>, <given-names>S.</given-names></string-name>, <string-name><surname>Li</surname>, <given-names>J.</given-names></string-name>, <string-name><surname>Zhang</surname>, <given-names>P.</given-names></string-name>, &amp; <string-name><surname>Zhang</surname>, <given-names>Y.</given-names></string-name></person-group> (<year>2021</year>). <article-title>Natural language processing meets quantum physics: A survey and categorization</article-title>. <source>Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing</source>, <month>November</month> <day>7</day>&#x2013;<day>11</day>, <fpage>3172</fpage>&#x2013;<lpage>3182</lpage>. Retrieved from <ext-link xmlns:xlink="http://www.w3.org/1999/xlink" ext-link-type="uri" xlink:type="simple" xlink:href="https://aclanthology.org/2021.emnlp-main.254.pdf">https://aclanthology.org/2021.emnlp-main.254.pdf</ext-link>. <ext-link xmlns:xlink="http://www.w3.org/1999/xlink" ext-link-type="doi" xlink:type="simple" xlink:href="https://doi.org/10.18653/v1/2021.emnlp-main.254">https://doi.org/10.18653/v1/2021.emnlp-main.254</ext-link></mixed-citation></ref>
image

Example 2:
image

Front-end Issues

If the issue is front-end specific please add the following details:

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.