Skip to content

Commit

Permalink
simplify url link in graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Nov 29, 2019
1 parent 811f214 commit abfcb5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/graphql/types/doi_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ def formatted_citation(style: nil, locale: nil)
bibliography = cp.render :bibliography, id: normalize_doi(object.doi)
url = object.doi
unless /^https?:\/\//i.match?(object.doi)
url = "https://doi.org/#{object.doi}"
url = "https://doi.org/#{object.doi}"
end
bibliography.first.gsub(url,doi_link(url))
bibliography.first.gsub(url, doi_link(url))
end

def doi_link(url)
"<a href='#{url}' target='_blank' title='Go to landing page' class='item'> #{url} </a>"
"<a href='#{url}'>#{url}</a>"
end

def citeproc_hsh
Expand Down

0 comments on commit abfcb5a

Please sign in to comment.