Skip to content

Commit

Permalink
Fixed bug when number has , on scholar citations
Browse files Browse the repository at this point in the history
  • Loading branch information
george-gca authored Feb 13, 2024
1 parent a0bcaaf commit b4e4232
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _plugins/google-scholar-citations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ def render(context)
matches = cited_by_text.match(/Cited by (\d+[,\d]*)/)

if matches
citation_count = matches[1].to_i
citation_count = matches[1].sub(",", "").to_i
end

elsif !og_description_meta.empty?
cited_by_text = og_description_meta[0]['content']
matches = cited_by_text.match(/Cited by (\d+[,\d]*)/)

if matches
citation_count = matches[1].to_i
citation_count = matches[1].sub(",", "").to_i
end
end

Expand All @@ -75,4 +75,4 @@ def render(context)
end
end

Liquid::Template.register_tag('google_scholar_citations', Jekyll::GoogleScholarCitationsTag)
Liquid::Template.register_tag('google_scholar_citations', Jekyll::GoogleScholarCitationsTag)

0 comments on commit b4e4232

Please sign in to comment.