Skip to content

Add ADD_FORBID_CONTENTS setting#1168

Merged
cure53 merged 1 commit intocure53:mainfrom
MariusRumpf:add-forbid-contents
Nov 10, 2025
Merged

Add ADD_FORBID_CONTENTS setting#1168
cure53 merged 1 commit intocure53:mainfrom
MariusRumpf:add-forbid-contents

Conversation

@MariusRumpf
Copy link
Contributor

Summary

This PR implements the option ADD_FORBID_CONTENTS discussed in #1165 and adds two tests to check that.

Background & Context

DOMPurify has an internal default list for the FORBID_CONTENTS setting, which is used when it is not set. To allow extending the default DEFAULT_FORBID_CONTENTS this adds a new configuration option ADD_FORBID_CONTENTS. This configuration option extends the default or user given list in FORBID_CONTENTS.

Given this option, it is no longer required to keep a copy of the DEFAULT_FORBID_CONTENTS in code as a user of this library.

Resolves #1165.

@cure53
Copy link
Owner

cure53 commented Nov 10, 2025

Whoa, thanks :D

@cure53 cure53 merged commit 27e8496 into cure53:main Nov 10, 2025
8 checks passed
@MariusRumpf MariusRumpf deleted the add-forbid-contents branch November 10, 2025 13:13
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.

Allow extending, not replacing default "FORBID_CONTENTS" list via setConfig

2 participants