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

Simple fixes for broken DOIs (and alternate URLs) #22

Closed
jimallman opened this issue Sep 10, 2014 · 1 comment
Closed

Simple fixes for broken DOIs (and alternate URLs) #22

jimallman opened this issue Sep 10, 2014 · 1 comment

Comments

@jimallman
Copy link
Collaborator

This is a short-term fix for the problems outlined in #20.

When we want to show a link to a DOI (or other URL), the page will check to see if it's a complete URL or a fragment. If the DOI (or URL) starts with http: or https:, it will be linked as-is. Otherwise, we should assume it’s a “bare” DOI and turn it into a CrossRef URL for display.

Given that the group submitting data is both small and trusted, this might be sufficient.

@jimallman
Copy link
Collaborator Author

I've added a few more touches to accommodate the existing variety of DOIs in the system.

  • Strip all whitespace (including spaces, tabs, line returns) from the DOI/URL
  • Strip any doi: or DOI: prefix
  • Sheck for leading http: or https:
    • IF found, return the current string
    • ELSE wrap it in a CrossRef URL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant