---
title: "sanitize 7.0.0 Breaking Changes on RubyGems | Since.dev"
description: "What each sanitize release removed, renamed or changed: 30 breaking changes in 6 versions on RubyGems, each with its source."
canonical_url: https://since.dev/packages/gem/sanitize
last_updated: 2026-12-04
---

# 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

Latest version `7.0.3`, released December 1, 2026. [Source repository](https://github.com/rgrove/sanitize)

Its 7.0.0 release requires Ruby 3.1.0 or later. [Ruby end of life dates](https://since.dev/calendar/ruby.md).

- From [6.0.0](#v-6-0-0) to [7.0.0](#v-7-0-0): 2 breaking changes in 1 version.
- From [2.0.0](#v-2-0-0) to [7.0.0](#v-7-0-0): 28 breaking changes in 5 versions.

## sanitize 7.0.0 breaking changes

sanitize 7.0.0, released December 30, 2024: 2 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](https://github.com/rgrove/sanitize/releases/tag/v7.0.0)
- **Configuration changed**  

Sanitize now requires Nokogiri 1.16.8 or a higher version, so older Nokogiri installs must be upgraded. [github.com](https://github.com/rgrove/sanitize/releases/tag/v7.0.0)

## sanitize 6.0.0 breaking changes

sanitize 6.0.0, released August 4, 2021: 3 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](https://github.com/rgrove/sanitize/releases/tag/v6.0.0)
- **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](https://github.com/rgrove/sanitize/releases/tag/v6.0.0)
- **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](https://github.com/rgrove/sanitize/releases/tag/v6.0.0)

## sanitize 5.0.0 breaking changes

sanitize 5.0.0, released October 15, 2018: 8 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](https://github.com/rgrove/sanitize/releases/tag/v5.0.0)
- **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](https://github.com/rgrove/sanitize/releases/tag/v5.0.0)
- **Behavior changed** `iframe`  

When iframe is removed, its children are now removed too instead of being preserved and escaped. [github.com](https://github.com/rgrove/sanitize/releases/tag/v5.0.0)
- **Behavior changed** `noembed`  

When noembed is removed, its children are now removed too instead of being preserved and escaped. [github.com](https://github.com/rgrove/sanitize/releases/tag/v5.0.0)
- **Behavior changed** `noframes`  

When noframes is removed, its children are now removed too instead of being preserved and escaped. [github.com](https://github.com/rgrove/sanitize/releases/tag/v5.0.0)
- **Behavior changed** `noscript`  

When noscript is removed, its children are now removed too instead of being preserved and escaped. [github.com](https://github.com/rgrove/sanitize/releases/tag/v5.0.0)
- **Behavior changed** `script`  

When script is removed, its children are now removed too instead of being preserved and escaped. [github.com](https://github.com/rgrove/sanitize/releases/tag/v5.0.0)
- **Behavior changed** `style`  

When style is removed, its children are now removed too instead of being preserved and escaped. [github.com](https://github.com/rgrove/sanitize/releases/tag/v5.0.0)

## sanitize 4.0.0 breaking changes

sanitize 4.0.0, released April 20, 2015: 1 breaking change.

- **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](https://github.com/rgrove/sanitize/releases/tag/v4.0.0)

## sanitize 3.0.0 breaking changes

sanitize 3.0.0, released June 21, 2014: 14 breaking changes.

- **Removed** `:output`  

Output is now always HTML, not XHTML. [github.com](https://github.com/rgrove/sanitize/releases/tag/v3.0.0)
- **Removed** `:output_encoding`  

Output is now always UTF-8. [github.com](https://github.com/rgrove/sanitize/releases/tag/v3.0.0)
- **Removed** `:transformers_breadth`  

The :transformers_breadth config option has been removed. [github.com](https://github.com/rgrove/sanitize/releases/tag/v3.0.0)
- **Removed** `clean_document!`  

The clean_document! method was removed. [github.com](https://github.com/rgrove/sanitize/releases/tag/v3.0.0)
- **Removed** `clean!`  

The clean! method was removed. [github.com](https://github.com/rgrove/sanitize/releases/tag/v3.0.0)
- **Renamed** `clean`  

Use fragment instead of clean to sanitize HTML fragments. [github.com](https://github.com/rgrove/sanitize/releases/tag/v3.0.0)
- **Renamed** `clean_document`  

Use document instead of clean_document. [github.com](https://github.com/rgrove/sanitize/releases/tag/v3.0.0)
- **Renamed** `clean_node!`  

Use node! instead of clean_node!. [github.com](https://github.com/rgrove/sanitize/releases/tag/v3.0.0)
- **Behavior changed**  

Parsing moved from libxml2 to Google's Gumbo HTML5 parser, so HTML output may differ from earlier versions. [github.com](https://github.com/rgrove/sanitize/releases/tag/v3.0.0)
- **Behavior changed**  

Transformers run from the top down starting with the first node; old bottom-up transformers may need rewriting. [github.com](https://github.com/rgrove/sanitize/releases/tag/v3.0.0)

And 4 more in this version. [Sign up to see every change](https://app.since.dev/login?mode=signup&src=package-page)

## sanitize 2.0.0 breaking changes

sanitize 2.0.0, released January 15, 2011: 2 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](https://github.com/rgrove/sanitize/blob/release-2.0.0/HISTORY.md)
- **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](https://github.com/rgrove/sanitize/blob/release-2.0.0/HISTORY.md)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#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.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
