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

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