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

# sanitize-html breaking changes

sanitize-html 2.0.0 (September 23, 2020) is its newest release with breaking changes, 28 of them. The first: Browser-linkable build file is no longer provided in sanitize-html 2.0.0. Every breaking API change we have recorded in sanitize-html on npm: 30 breaking changes in 3 versions. Below, its 3 versions with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `2.18.2`, released November 11, 2026. [Source repository](https://github.com/apostrophecms/apostrophe)

Its 2.0.0 release requires Node.js 10 or later. [Node.js end of life dates](https://since.dev/calendar/nodejs.md).

- From [2.0.0-beta](#v-2-0-0-beta) to [2.0.0](#v-2-0-0): 29 breaking changes in 2 versions.

## sanitize-html 2.0.0 breaking changes

sanitize-html 2.0.0, released September 23, 2020: 28 breaking changes.

- **Removed**  

sanitize-html is no longer linked directly in the browser. Include it in your project build instead. [github.com](https://github.com/apostrophecms/sanitize-html/blob/2.0.0/CHANGELOG.md)
- **Removed**  

Node.js 11 and 13 are no longer supported, and Node.js 10 or higher is now required. [github.com](https://github.com/apostrophecms/sanitize-html/blob/2.0.0/CHANGELOG.md)
- **Default changed** `allowedTags`  

The default allowedTags array now includes many more HTML tags. Review the defaults if you do not override them. [github.com](https://github.com/apostrophecms/sanitize-html/blob/2.0.0/CHANGELOG.md)
- **Signature changed** `AllowedAttribute`  

Was type AllowedAttribute = string | {name: string; multiple?: boolean; values: string\[\]}; now type AllowedAttribute = string | {name: string; multiple?: boolean | undefined; values: string\[\]}. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `defaults`  

Was let defaults: IDefaults; now const defaults: IDefaults. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `DisallowedTagsModes`  

Was type DisallowedTagsModes = 'discard' | 'escape' | 'recursiveEscape'; now type DisallowedTagsModes = "discard" | "escape" | "recursiveEscape" | "completelyDiscard". [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IDefaults.allowedAttributes`  

Was allowedAttributes: {\[index: string\]: AllowedAttribute\[\]}; now allowedAttributes: Record\<string, AllowedAttribute\[\]>. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.allowedAttributes`  

Was allowedAttributes?: {\[index: string\]: AllowedAttribute\[\]} | boolean; now allowedAttributes?: Record\<string, AllowedAttribute\[\]> | false | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.allowedClasses`  

Was allowedClasses?: {\[index: string\]: string\[\] | boolean}; now allowedClasses?: {\[index: string\]: boolean | Array\<string | RegExp>} | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.allowedIframeDomains`  

Was allowedIframeDomains?: string\[\]; now allowedIframeDomains?: string\[\] | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.allowedIframeHostnames`  

Was allowedIframeHostnames?: string\[\]; now allowedIframeHostnames?: string\[\] | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.allowedSchemes`  

Was allowedSchemes?: string\[\] | boolean; now allowedSchemes?: string\[\] | boolean | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.allowedSchemesAppliedToAttributes`  

Was allowedSchemesAppliedToAttributes?: string\[\]; now allowedSchemesAppliedToAttributes?: string\[\] | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.allowedSchemesByTag`  

Was allowedSchemesByTag?: {\[index: string\]: string\[\]} | boolean; now allowedSchemesByTag?: {\[index: string\]: string\[\]} | boolean | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.allowedStyles`  

Was allowedStyles?: {\[index: string\]: {\[index: string\]: RegExp\[\]}}; now allowedStyles?: {\[index: string\]: {\[index: string\]: RegExp\[\]}} | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.allowedTags`  

Was allowedTags?: string\[\] | boolean; now allowedTags?: string\[\] | false | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.allowIframeRelativeUrls`  

Was allowIframeRelativeUrls?: boolean; now allowIframeRelativeUrls?: boolean | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.allowProtocolRelative`  

Was allowProtocolRelative?: boolean; now allowProtocolRelative?: boolean | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.allowVulnerableTags`  

Was allowVulnerableTags?: boolean; now allowVulnerableTags?: boolean | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.disallowedTagsMode`  

Was disallowedTagsMode?: DisallowedTagsModes; now disallowedTagsMode?: DisallowedTagsModes | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.enforceHtmlBoundary`  

Was enforceHtmlBoundary?: boolean; now enforceHtmlBoundary?: boolean | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.exclusiveFilter`  

Was exclusiveFilter?: (frame: IFrame) => boolean; now exclusiveFilter?: ((frame: IFrame) => boolean | "excludeTag") | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.nonTextTags`  

Was nonTextTags?: string\[\]; now nonTextTags?: string\[\] | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.parser`  

Was parser?: ParserOptions; now parser?: ParserOptions | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.selfClosing`  

Was selfClosing?: string\[\]; now selfClosing?: string\[\] | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.textFilter`  

Was textFilter?: (text: string, tagName: string) => string; now textFilter?: ((text: string, tagName: string) => string) | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `IOptions.transformTags`  

Was transformTags?: {\[tagName: string\]: string | Transformer}; now transformTags?: {\[tagName: string\]: string | Transformer} | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)
- **Signature changed** `Tag.text`  

Was text?: string; now text?: string | undefined. [npmjs.com](https://www.npmjs.com/package/sanitize-html/v/2.0.0)

## sanitize-html 2.0.0-beta.2 breaking changes

sanitize-html 2.0.0-beta.2, released September 23, 2020: 1 breaking change.

- **Default changed** `allowedTags`  

The default allowedTags no longer include iframe and nl. Pass them explicitly if your code needs them. [github.com](https://github.com/apostrophecms/sanitize-html/blob/2.0.0/CHANGELOG.md)

## sanitize-html 2.0.0-beta breaking changes

sanitize-html 2.0.0-beta, released September 23, 2020: 1 breaking change.

- **Behavior changed**  

The package no longer ships a build. Projects that include sanitize-html must add it to their own build. [github.com](https://github.com/apostrophecms/sanitize-html/blob/2.0.0/CHANGELOG.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.
