From b4e423286b30bddaf83905c8b4c89f6ae46b545f Mon Sep 17 00:00:00 2001 From: George <31376482+george-gca@users.noreply.github.com> Date: Tue, 13 Feb 2024 13:56:13 -0300 Subject: [PATCH] Fixed bug when number has , on scholar citations --- _plugins/google-scholar-citations.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_plugins/google-scholar-citations.rb b/_plugins/google-scholar-citations.rb index 78dd1a1ce32a..b87e346c4f5b 100644 --- a/_plugins/google-scholar-citations.rb +++ b/_plugins/google-scholar-citations.rb @@ -46,7 +46,7 @@ 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? @@ -54,7 +54,7 @@ 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 end @@ -75,4 +75,4 @@ def render(context) end end -Liquid::Template.register_tag('google_scholar_citations', Jekyll::GoogleScholarCitationsTag) \ No newline at end of file +Liquid::Template.register_tag('google_scholar_citations', Jekyll::GoogleScholarCitationsTag)