Skip to content

Commit

Permalink
Merge pull request #285 from AlexV525/fix/count-parse
Browse files Browse the repository at this point in the history
🐛 Fix contribution count's regular expression parsing
  • Loading branch information
jasonlong authored Nov 3, 2023
2 parents d0034a9 + 785be4a commit 7d97aa9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/iso.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ const setContainerViewType = (type) => {

const getCountFromNode = (node) => {
// Contribution label formats:
// No contributions on January 9, 2023
// 1 contribution on January 10, 2023
const contributionMatches = node.innerHTML.match(/(\d*|No) contributions? on ((.*) (\d{1,2}), (\d{4,}))/)
// No contributions on January 9th
// 1 contribution on January 10th.
// 2 contributions on August 31st.
const contributionMatches = node.innerHTML.match(/(\d*|No) contributions? on (.*)./)

if (!contributionMatches) {
return 0
Expand Down

0 comments on commit 7d97aa9

Please sign in to comment.