Skip to content

Conversation

bukinoshita
Copy link
Member

Remove the yarn.lock that was causing dependency conflicts — we should only have 1 yarn.lock that lives in the root.

@bukinoshita bukinoshita marked this pull request as ready for review September 22, 2022 21:40
@bukinoshita bukinoshita merged commit c8668f4 into main Sep 22, 2022
@bukinoshita bukinoshita deleted the fix/remove-yarn-lock branch September 22, 2022 21:41
iagocavalcante added a commit to iagocavalcante/react-email that referenced this pull request Oct 7, 2025
…reaking HTML structure

- Remove html-entities dependency and use targeted string replacements
- Only decode safe entities: &, ", ', &resend#39;
- Preserve < and > to avoid breaking HTML tags
- Fix import ordering to satisfy biome lint
- Update tests to match new behavior

This fixes the CI build error where decoding was too aggressive and broke
<td> tags in email templates.
iagocavalcante added a commit to iagocavalcante/react-email that referenced this pull request Oct 7, 2025
The previous fix was still breaking HTML by decoding quotes in href attributes.
For example: href="url?foo=&quot;bar&quot;" became href="url?foo="bar""
which breaks the attribute syntax.

Changes:
- Split decoding logic into decodeHrefValue and decodeStyleValue
- href attributes: only decode &amp; (fixes URL query parameters)
- style attributes: decode &amp;, &quot;, &#x27;, &resend#39; (fixes font-family)

This preserves HTML structure while fixing the original issue resend#1767.
iagocavalcante added a commit to iagocavalcante/react-email that referenced this pull request Oct 8, 2025
Fixes resend#1767 - This resolves the issue where React's renderToStaticMarkup
encodes quotes in style attributes as HTML entities (&quot;), which can
break CSS font-family declarations with quoted font names.

The fix:
- Created decodeAttributeEntities utility function
- Decodes &quot;, &#x27;, &resend#39;, and &amp; in style attributes
- Only decodes &amp; in href attributes to preserve HTML structure
- Added comprehensive tests to verify correct decoding

Changes:
- packages/render/src/shared/utils/decode-html-entities.ts: New utility
- packages/render/src/node/render.tsx: Apply decoding after rendering
- packages/render/src/browser/render.tsx: Apply decoding after rendering
- packages/render/src/edge/render.tsx: Apply decoding after rendering
- packages/render/src/node/render-node.spec.tsx: Added tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
iagocavalcante added a commit to iagocavalcante/react-email that referenced this pull request Oct 8, 2025
Fixes resend#1767 - This resolves the issue where React's renderToStaticMarkup
encodes quotes in style attributes as HTML entities (&quot;), which can
break CSS font-family declarations with quoted font names.

The fix:
- Created decodeAttributeEntities utility function
- Decodes &quot;, &#x27;, &resend#39;, and &amp; in style attributes
- Only decodes &amp; in href attributes to preserve HTML structure
- Added comprehensive tests to verify correct decoding

Changes:
- packages/render/src/shared/utils/decode-html-entities.ts: New utility
- packages/render/src/node/render.tsx: Apply decoding after rendering
- packages/render/src/browser/render.tsx: Apply decoding after rendering
- packages/render/src/edge/render.tsx: Apply decoding after rendering
- packages/render/src/node/render-node.spec.tsx: Added tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant