sanitize breaking changes
sanitize 7.0.0 (December 30, 2024) is its newest release with breaking changes, 2 of them. The first: sanitize 7.0.0 requires Ruby 3.1.0 or later. Every breaking API change we have recorded in sanitize on RubyGems: 30 breaking changes in 6 versions. Below, its 6 versions with breaking changes, newest first, removals and renames first, each with its source.
Updated December 4, 2026
On this page
Latest version 7.0.3, released December 1, 2026. Source repository
Its 7.0.0 release requires Ruby 3.1.0 or later. Ruby end of life dates.
- From 6.0.0 to 7.0.0: 2 breaking changes in 1 version.
- From 2.0.0 to 7.0.0: 28 breaking changes in 5 versions.
sanitize 7.0.0 breaking changes
- Configuration changed
Sanitize 7.0.0 no longer supports end-of-life Ruby versions; Ruby 3.1.0 or later is now required. github.com - Configuration changed
Sanitize now requires Nokogiri 1.16.8 or a higher version, so older Nokogiri installs must be upgraded. github.com
sanitize 6.0.0 breaking changes
- Removed
The gem now officially supports Ruby 2.5.0 as the oldest version. Users on older Ruby versions must upgrade Ruby before updating. github.com - Removed
Nokogumbo is no longer a separate dependency of Sanitize. Code that relies on Nokogumbo being loaded directly must add it or get it through Nokogiri. github.com - Configuration changed
Sanitize now needs Nokogiri 1.12.0 or newer, which bundles Nokogumbo. Projects pinned to an older Nokogiri must upgrade it. github.com
sanitize 5.0.0 breaking changes
- Behavior changed
HTML output may differ in small ways from 4.x because the HTML parser and serializer were upgraded. Review output if it matters to you. github.com - Behavior changed
:remove_contents
Previously an Array value for remove_contents acted as true. It now behaves as the Array it is, so code relying on the old behavior may change output. github.com - Behavior changed
iframe
When iframe is removed, its children are now removed too instead of being preserved and escaped. github.com - Behavior changed
noembed
When noembed is removed, its children are now removed too instead of being preserved and escaped. github.com - Behavior changed
noframes
When noframes is removed, its children are now removed too instead of being preserved and escaped. github.com - Behavior changed
noscript
When noscript is removed, its children are now removed too instead of being preserved and escaped. github.com - Behavior changed
script
When script is removed, its children are now removed too instead of being preserved and escaped. github.com - Behavior changed
style
When style is removed, its children are now removed too instead of being preserved and escaped. github.com
sanitize 4.0.0 breaking changes
- Configuration changed
:at_rules
At-rules with blocks were previously hard-coded. Custom configs with an :at_rules setting may need to move those rules to :at_rules_with_properties or :at_rules_with_styles. github.com
sanitize 3.0.0 breaking changes
- Removed
:output
Output is now always HTML, not XHTML. github.com - Removed
:output_encoding
Output is now always UTF-8. github.com - Removed
:transformers_breadth
The :transformers_breadth config option has been removed. github.com - Removed
clean_document!
The clean_document! method was removed. github.com - Removed
clean!
The clean! method was removed. github.com - Renamed
clean
Use fragment instead of clean to sanitize HTML fragments. github.com - Renamed
clean_document
Use document instead of clean_document. github.com - Renamed
clean_node!
Use node! instead of clean_node!. github.com - Behavior changed
Parsing moved from libxml2 to Google's Gumbo HTML5 parser, so HTML output may differ from earlier versions. github.com - Behavior changed
Transformers run from the top down starting with the first node; old bottom-up transformers may need rewriting. github.com
And 4 more in this version. Sign up to see every change
sanitize 2.0.0 breaking changes
- Behavior changed
The environment data passed into transformers and the return values expected from transformers changed. Update existing transformers to the new format described in the README. github.com - Behavior changed
Transformers are called for all node types, not only element nodes. Transformers that assume element nodes must handle other node types. github.com
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.