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

Swap dompurify for node-friendly version. #9

Merged
merged 6 commits into from
May 27, 2022
Merged

Conversation

mathewjordan
Copy link
Member

@mathewjordan mathewjordan commented May 27, 2022

What does this do?

Initial use of dompurify

😢 Initially, I opted to use dompurify as a package for rendering markup in #4. This works fine if Nectar is being used in a browser environment, however, showed issues on server side generation in a node environment in Next.js.

Trial isomorphic-dompurify

😡 I then tried https://www.npmjs.com/package/isomorphic-dompurify however there is a specific issue regarding it related to Next.js that makes it unusable in that platform, see also kkomelin/isomorphic-dompurify#54 (comment).

Settled on sanitize-html

😃 So, now we are using https://www.npmjs.com/package/sanitize-html which seems to work in node environments. I've tested this Nectar build in Next.js using a local npm link and we should be good to go. There is a nice @types package for this as well.

@mathewjordan mathewjordan self-assigned this May 27, 2022
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.

2 participants