Skip to content

Conversation

@obenjiro
Copy link
Contributor

@obenjiro obenjiro commented Jul 7, 2025

Summary

  • switch sanitize utilities from cheerio to parse5
  • traverse parse5 AST without CSS selectors
  • adjust htmlparser2 dependency test

Why remove cheerio?

  1. All stable releases of cheerio (1.0.0 and 1.1.0) depend on newer majors of htmlparser2 (9.x and 10.x respectively).
    In contrast, sanitize-html—including its latest version 2.17.0—depends on htmlparser2 8.x.

Because there’s no stable cheerio version using htmlparser2 8.x, the only way to share a single htmlparser2 version without overrides is to use the release‑candidate cheerio 1.0.0-rc.12 currently present in package.json.

  1. cheerio seems to be not actively maintained at the moment
    Using htmlparser2 results in mutilated doctype cheeriojs/cheerio#4068 (comment)

fixes #547

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.

htmlparser2 duplicated

1 participant