Skip to content

Commit 6fc446a

Browse files
authored
Merge pull request #1175 from cure53/main
Getting 3.x branch ready for 3.3.1 release
2 parents 2d70dc8 + 3b3bf91 commit 6fc446a

20 files changed

+110
-34
lines changed

.github/workflows/build-and-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222

2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v5
25+
uses: actions/checkout@v6
2626
- name: Setup Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@v5
27+
uses: actions/setup-node@v6
2828
with:
2929
node-version: ${{ matrix.node-version }}
3030
cache: 'npm'

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: Checkout repository
28-
uses: actions/checkout@v5
28+
uses: actions/checkout@v6
2929
with:
3030
# We must fetch at least the immediate parents so that if this is
3131
# a pull request then we can checkout the head.
@@ -38,14 +38,14 @@ jobs:
3838

3939
# Initializes the CodeQL tools for scanning.
4040
- name: Initialize CodeQL
41-
uses: github/codeql-action/init@v3
41+
uses: github/codeql-action/init@v4
4242
with:
4343
languages: ${{ matrix.language }}
4444

4545
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
4646
# If this step fails, then you should remove it and run the build manually (see below)
4747
- name: Autobuild
48-
uses: github/codeql-action/autobuild@v3
48+
uses: github/codeql-action/autobuild@v4
4949

5050
# ℹ️ Command-line programs to run using the OS shell.
5151
# 📚 https://git.io/JvXDl
@@ -59,4 +59,4 @@ jobs:
5959
# make release
6060

6161
- name: Perform CodeQL Analysis
62-
uses: github/codeql-action/analyze@v3
62+
uses: github/codeql-action/analyze@v4

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG.
66

7-
It's also very simple to use and get started with. DOMPurify was [started in February 2014](https://github.com/cure53/DOMPurify/commit/a630922616927373485e0e787ab19e73e3691b2b) and, meanwhile, has reached version **v3.3.0**.
7+
It's also very simple to use and get started with. DOMPurify was [started in February 2014](https://github.com/cure53/DOMPurify/commit/a630922616927373485e0e787ab19e73e3691b2b) and, meanwhile, has reached version **v3.3.1**.
88

99
DOMPurify is written in JavaScript and works in all modern browsers (Safari (10+), Opera (15+), Edge, Firefox and Chrome - as well as almost anything else using Blink, Gecko or WebKit). It doesn't break on MSIE or other legacy browsers. It simply does nothing.
1010

@@ -368,6 +368,9 @@ const clean = DOMPurify.sanitize(dirty, {FORCE_BODY: true});
368368
// remove all <a> elements under <p> elements that are removed
369369
const clean = DOMPurify.sanitize(dirty, {FORBID_CONTENTS: ['a'], FORBID_TAGS: ['p']});
370370

371+
// extend the default FORBID_CONTENTS list to also remove <a> elements under <p> elements
372+
const clean = DOMPurify.sanitize(dirty, {ADD_FORBID_CONTENTS: ['a'], FORBID_TAGS: ['p']});
373+
371374
// change the parser type so sanitized data is treated as XML and not as HTML, which is the default
372375
const clean = DOMPurify.sanitize(dirty, {PARSER_MEDIA_TYPE: 'application/xhtml+xml'});
373376
```

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dompurify",
3-
"version": "3.3.0",
3+
"version": "3.3.1",
44
"homepage": "https://github.com/cure53/DOMPurify",
55
"author": "Cure53 <[email protected]>",
66
"description": "A DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG",

dist/purify.cjs.d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */
1+
/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
22

3-
import { TrustedTypePolicy, TrustedHTML, TrustedTypesWindow } from 'trusted-types/lib';
3+
import { TrustedTypePolicy, TrustedHTML, TrustedTypesWindow } from 'trusted-types/lib/index.js';
44

55
/**
66
* Configuration to control DOMPurify behavior.
@@ -94,6 +94,10 @@ interface Config {
9494
* Add child elements to be removed when their parent is removed.
9595
*/
9696
FORBID_CONTENTS?: string[] | undefined;
97+
/**
98+
* Extend the existing or default array of forbidden content elements.
99+
*/
100+
ADD_FORBID_CONTENTS?: string[] | undefined;
97101
/**
98102
* Add elements to block-list.
99103
*/

dist/purify.cjs.js

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.cjs.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.es.d.mts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */
1+
/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
22

3-
import { TrustedTypePolicy, TrustedHTML, TrustedTypesWindow } from 'trusted-types/lib';
3+
import { TrustedTypePolicy, TrustedHTML, TrustedTypesWindow } from 'trusted-types/lib/index.js';
44

55
/**
66
* Configuration to control DOMPurify behavior.
@@ -94,6 +94,10 @@ interface Config {
9494
* Add child elements to be removed when their parent is removed.
9595
*/
9696
FORBID_CONTENTS?: string[] | undefined;
97+
/**
98+
* Extend the existing or default array of forbidden content elements.
99+
*/
100+
ADD_FORBID_CONTENTS?: string[] | undefined;
97101
/**
98102
* Add elements to block-list.
99103
*/

dist/purify.es.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */
1+
/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
22

33
const {
44
entries,
@@ -305,7 +305,7 @@ const _createHooksMap = function _createHooksMap() {
305305
function createDOMPurify() {
306306
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
307307
const DOMPurify = root => createDOMPurify(root);
308-
DOMPurify.version = '3.3.0';
308+
DOMPurify.version = '3.3.1';
309309
DOMPurify.removed = [];
310310
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
311311
// Not running in a browser, provide a factory function
@@ -651,6 +651,12 @@ function createDOMPurify() {
651651
}
652652
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
653653
}
654+
if (cfg.ADD_FORBID_CONTENTS) {
655+
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
656+
FORBID_CONTENTS = clone(FORBID_CONTENTS);
657+
}
658+
addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
659+
}
654660
/* Add #text in case KEEP_CONTENT is set to true */
655661
if (KEEP_CONTENT) {
656662
ALLOWED_TAGS['#text'] = true;

dist/purify.es.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)