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
…30489) (#30563)

(cherry picked from commit 75e234a)

Co-authored-by: Joe Milne <joekmilne@gmail.com>
  • Loading branch information
vladar and JobenM committed Mar 30, 2021
1 parent b9dfd16 commit 21804e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/gatsby-plugin-mdx/gatsby/source-nodes.js
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 21804e3

Please sign in to comment.