react-email icon indicating copy to clipboard operation
react-email copied to clipboard

[BUG] respect html entities

Open haxxxton opened this issue 2 years ago • 2 comments

When performing a email export, the output file appears to replace htmlentities with their rendered equivalent rather than leave them as htmlentities.

Steps to reproduce:

  • add   or ’ to a template
  • run email export
  • rendered output contains and ’ rather than htmlentity

haxxxton avatar Feb 04 '23 08:02 haxxxton

Seems like react-dom itself is the one who replaces the html entities like that. Maybe the JSX transform, actually?

If you wrap your entities like:

<>{'&nbsp;'}</>

The entities will be kept the same, as long as you don't have --pretty.

gabrielmfern avatar Mar 28 '24 11:03 gabrielmfern

I'm working on a custom renderer that I thought would tackle this, but it seems like React itself replaces the HTML entities, not react-dom and not even the JSX Runtime.

gabrielmfern avatar May 24 '24 17:05 gabrielmfern