Skip to content

Commit

Permalink
fix(gatsby-plugin-mdx): timeToRead returns NaN when word count is 0 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
JobenM authored Mar 26, 2021
1 parent 35c90f8 commit 75e234a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/gatsby-plugin-mdx/gatsby/source-nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ async function getCounts({ mdast }) {
}

return {
paragraphs: counts.ParagraphNode,
sentences: counts.SentenceNode,
words: counts.WordNode,
paragraphs: counts.ParagraphNode || 0,
sentences: counts.SentenceNode || 0,
words: counts.WordNode || 0,
}
}

Expand Down

0 comments on commit 75e234a

Please sign in to comment.