Skip to content

feat: add sanitize-html → neosanitize replacement#1

Closed
PuruVJ wants to merge 1 commit into
mainfrom
add-sanitize-html-neosanitize
Closed

feat: add sanitize-html → neosanitize replacement#1
PuruVJ wants to merge 1 commit into
mainfrom
add-sanitize-html-neosanitize

Conversation

@PuruVJ

@PuruVJ PuruVJ commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

Adds sanitize-html to the preferred manifest, with:

  • neosanitize/legacy as a direct, drop-in replacement — a byte-identical port of sanitize-html 2.x (same API, same options, same output), so migration is just an import swap.
  • neosanitize (root module) as the recommended alternative — a fast, browser-faithful WHATWG parser (100% html5lib tokenizer conformance) with a deny-by-default policy.

Includes a docs/modules/sanitize-html.md page with migration examples for both engines.

Migration

// Zero-change drop-in
import sanitizeHtml from 'sanitize-html'      // before
import sanitizeHtml from 'neosanitize/legacy' // after

Notes

  • Placed in preferred (performance/footprint replacement — not native, not a micro-utility).
  • Both replacements are represented as documented entries; the mapping points to the new e18e doc page.
  • pnpm lint passes (JSON schema, sort order, doc-path checks, Prettier).

🤖 Generated with Claude Code

Add sanitize-html to the preferred manifest with neosanitize/legacy as a
drop-in replacement and the neosanitize root module (fast WHATWG parser,
deny-by-default) as the recommended alternative. Includes docs page.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: cf3e1d1

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.

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

@PuruVJ

PuruVJ commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

Wrong target — this belongs upstream (e18e#780).

@PuruVJ PuruVJ closed this Jul 6, 2026
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