Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix doi urls in prefix duplication, and pmids/pmcids #132

Merged
merged 4 commits into from
Oct 30, 2021
Merged

Conversation

cormacrelf
Copy link
Collaborator

@cormacrelf cormacrelf commented Oct 30, 2021

Fixes #127, fixes #131

  • strip url prefix from prefix="... https://doi.org/" (etc)
    • internal note, simplifies the OutputFormat API to just take a Link and return a Self::Build. The list of url-ish variables didn't need to be specific to each OutputFormat implementation (we do only have two, but yeah)
  • Fix PMID / PMCID confusion
  • match more variants of PMID/PMCID urls
  • Confirm doi prefix-stripping works with link_anchors disabled

One note here is that PubMed has started redirecting PMID urls to e.g. https://pubmed.ncbi.nlm.nih.gov/34706787/, so that might be a better canonical url format. But for the moment it just does what the csl 1.1 spec says.

One more note, even when link anchors are turned off, any of the recognised prefixes are still stripped and the canonical URL prefix, which is always HTTPS, is put in its place.

@cormacrelf cormacrelf added the A-core Area: affects all builds of citeproc-rs label Oct 30, 2021
@cormacrelf cormacrelf merged commit 70764c7 into master Oct 30, 2021
@cormacrelf cormacrelf deleted the fix-127-131 branch October 30, 2021 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: affects all builds of citeproc-rs
Development

Successfully merging this pull request may close these issues.

PMID and PMCID urls are backwards In some scenarios prefix needs to be ignored when wrapping DOI
1 participant