Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(html-comment): Add components for handling html comments and outlook conditional comments #1629

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

Krombik
Copy link

@Krombik Krombik commented Aug 24, 2024

#1584

It use comment placeholders for each variant of possible usage: regular html comment, mso and non-mso comments with version and conditions support, ghost wrappers for mso and non-mso. Render method should be wrapped by replaceCommentPlaceholders to replace all placeholders by comments

Example

  <div>
    <Comment>comment</Comment>
    <Mso>
      <div>mso content</div>
    </Mso>
    <NonMso>
      <div>non-mso content</div>
    </NonMso>
    <MsoGhost
      ghostWrapper={(children) => (
        <table>
          <tr>
            <td>{children}</td>
          </tr>
        </table>
      )}
    >
      <div>content</div>
    </MsoGhost>
    <NonMsoGhost
      ghostWrapper={(children) => (
        <table>
          <tr>
            <td>{children}</td>
          </tr>
        </table>
      )}
    >
      <div>content</div>
    </NonMsoGhost>
  </div>

Output

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><div><!--comment--><!--[if mso]><div>mso content</div><![endif]--><!--[if !mso]><!--><div>non-mso content</div><!--<![endif]--><!--[if mso]><table><tr><td><![endif]--><div>content</div><!--[if mso]></td></tr></table><![endif]--><!--[if !mso]><!--><table><tr><td><!--<![endif]--><div>content</div><!--[if !mso]><!--></td></tr></table><!--<![endif]--></div>

Problems

replaceCommentPlaceholders should be used in render method, but it another lib and I'm not sure how i can use it with this structure

Copy link

changeset-bot bot commented Aug 24, 2024

⚠️ No Changeset found

Latest commit: fd33698

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Aug 24, 2024

@Krombik is attempting to deploy a commit to the resend Team on Vercel.

A member of the Team first needs to authorize it.

@Krombik
Copy link
Author

Krombik commented Aug 24, 2024

I added tests for 2 components, but until the render method uses replaceCommentPlaceholders, they cannot be passed

@gabrielmfern gabrielmfern force-pushed the canary branch 5 times, most recently from 92e6dc1 to 76bbf7b Compare September 13, 2024 14:35
@gabrielmfern gabrielmfern force-pushed the canary branch 2 times, most recently from 4473810 to ad2e6c4 Compare September 26, 2024 18:10
@gabrielmfern gabrielmfern force-pushed the canary branch 2 times, most recently from f69b971 to 86fe0ef Compare October 1, 2024 14:10
@gabrielmfern gabrielmfern force-pushed the canary branch 3 times, most recently from 0b21151 to 30a20d6 Compare October 14, 2024 14:58
@gabrielmfern gabrielmfern force-pushed the canary branch 4 times, most recently from 0426d02 to 868acde Compare November 5, 2024 19:07
@gabrielmfern gabrielmfern force-pushed the canary branch 2 times, most recently from 74d49e5 to 6facd7c Compare November 13, 2024 17:18
@gabrielmfern gabrielmfern force-pushed the canary branch 2 times, most recently from 4ee4d1d to 0187b0a Compare December 23, 2024 13:28
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