resend / react-email

💌 Build and send emails using React
https://react.email
MIT License
14.45k stars 656 forks source link

mso-font-width: NaN% #1643

Closed christoph-pflueger closed 2 weeks ago

christoph-pflueger commented 2 months ago

Describe the Bug

In the function computeFontWidthAndSpaceCount in the Button component, a division by zero results in <!--[if mso]><i style="mso-font-width:NaN%;mso-text-raise:18" hidden></i><![endif]-->.

Which package is affected (leave empty if unsure)

@react-email/button

Link to the code that reproduces this issue

https://github.com/resend/react-email/blob/canary/packages/button/src/__snapshots__/button.spec.tsx.snap

To Reproduce

Not needed, as even the snapshots contain the bug.

Expected Behavior

It should not result in NaN%

What's your node version? (if relevant)

No response

gabrielmfern commented 1 month ago

Can you check this out with @react-email/button@0.0.18-canary.0?

christoph-pflueger commented 1 month ago

Works as expected, thank you.

gabrielmfern commented 1 month ago

Nice to know! Let's just close this one once it is released out of canary