You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's possible to have an mdx components without words for example we sometimes have embedded videos/ youtube.
So in this use case the getCounts function returns words property of undefined because the AST visitor never hits a word/paragraph. Thus the calculation for timeToRead (Math.round(words / avgWPM)) returns NaN.
I propose we fallback to 0 for these properties returned in getCounts and then timeToRead can default to 1.
Description
It's possible to have an mdx components without words for example we sometimes have embedded videos/ youtube.
So in this use case the
getCounts
function returnswords
property ofundefined
because the AST visitor never hits a word/paragraph. Thus the calculation fortimeToRead
(Math.round(words / avgWPM)
) returnsNaN
.I propose we fallback to
0
for these properties returned ingetCounts
and thentimeToRead
can default to1
.Potential Fix
#30489
The text was updated successfully, but these errors were encountered: