Skip to content

Commit 2e42a71

Browse files
authored
🤖 Merge PR DefinitelyTyped#72543 feat(sanitize-html): add onOpenTag and onCloseTag options by @naktinis
1 parent 96c9dd4 commit 2e42a71

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

‎types/sanitize-html/index.d.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ declare namespace sanitize {
7878
*/
7979
enforceHtmlBoundary?: boolean | undefined;
8080
nonBooleanAttributes?: string[];
81+
onOpenTag?: ((name: string, attribs: Attributes) => void) | undefined;
82+
onCloseTag?: ((name: string, isImplied: boolean) => void) | undefined;
8183
}
8284

8385
const defaults: IDefaults;

‎types/sanitize-html/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@types/sanitize-html",
4-
"version": "2.15.9999",
4+
"version": "2.16.9999",
55
"projects": [
66
"https://github.com/punkave/sanitize-html"
77
],

‎types/sanitize-html/sanitize-html-tests.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ const options: IOptions = {
4545
allowedScriptDomains: ["test.com"],
4646
allowedScriptHostnames: ["test.com"],
4747
nonBooleanAttributes: ["href"],
48+
onOpenTag: (name: string, attribs: Attributes) => {},
49+
onCloseTag: (name: string, isImplied: boolean) => {},
4850
};
4951

5052
sanitize.defaults.allowedAttributes; // $ExpectType Record<string, AllowedAttribute[]>

0 commit comments

Comments
 (0)