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: add htmlWithOptions #22

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

KiwiKilian
Copy link

I would like to have an option to disable tailwind because when not used it might clash with other class names, see KiwiKilian/eleventy-plugin-og-image#216.

Therefore I've implemented htmlWithOptions, which could be extended if there shall be more configuration options. I hope it can find a place in the projects scope, otherwise I'm open to any suggestions.

Copy link

changeset-bot bot commented Jan 14, 2024

🦋 Changeset detected

Latest commit: 310ebcc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
satori-html Minor

Not sure what this means? Click here to learn what changesets are.

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

Comment on lines +93 to +95
if (options?.tailwind) {
tw(doc);
}
Copy link
Author

@KiwiKilian KiwiKilian Jan 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only changed this part, otherwise it's just returning the same function as before.

@@ -8,13 +8,15 @@ Generate a [satori](https://github.com/vercel/satori)-friendly VDOM from a strin

Unfortunately, it is built on top of React's JSX and [expects "React-elements-like objects"](https://github.com/vercel/satori#use-without-jsx). This library (`satori-html`) bridges that gap, generating the necessary VDOM object from a string of HTML.

> **Note**
> [!NOTE]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to the new syntax.

@KiwiKilian
Copy link
Author

@natemoo-re any chance you could have a look at this? Thanks 🙏

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