Skip to content

fix: replace isomorphic-dompurify with edge-compatible sanitizer#84

Merged
NicholaiVogel merged 1 commit intomainfrom
nicholai/fix-dompurify-edge
Feb 15, 2026
Merged

fix: replace isomorphic-dompurify with edge-compatible sanitizer#84
NicholaiVogel merged 1 commit intomainfrom
nicholai/fix-dompurify-edge

Conversation

@NicholaiVogel
Copy link
Copy Markdown
Contributor

Summary

  • Replace isomorphic-dompurify with a custom regex-based HTML sanitizer
  • isomorphic-dompurify depends on jsdom which requires Node.js APIs not available in Cloudflare Workers
  • The error JSDOM is not a constructor was breaking the conversations channel page

Test plan

  • Open a conversations channel page - should load without 500 error
  • Send a message with markdown - should render correctly
  • Verify XSS attempts are sanitized (script tags, event handlers removed)

… sanitizer

isomorphic-dompurify depends on jsdom which requires Node.js APIs not
available in Cloudflare Workers. Replaced with a simple regex-based
sanitizer that works in edge runtime.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
compass 0b25d15 Feb 15 2026, 10:39 PM

@NicholaiVogel NicholaiVogel merged commit 77130de into main Feb 15, 2026
7 of 10 checks passed
@NicholaiVogel NicholaiVogel deleted the nicholai/fix-dompurify-edge branch February 15, 2026 23:31
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