From 06b0334e47b9b80dd5703dc7d750a33238c6c571 Mon Sep 17 00:00:00 2001 From: tomotetra Date: Fri, 13 Mar 2020 08:49:03 +0900 Subject: [PATCH] update sanitize-html typing to 1.22.0 (#43002) --- types/sanitize-html/index.d.ts | 6 +++++- types/sanitize-html/sanitize-html-tests.ts | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/types/sanitize-html/index.d.ts b/types/sanitize-html/index.d.ts index b738c4a476..e6c39d0778 100644 --- a/types/sanitize-html/index.d.ts +++ b/types/sanitize-html/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for sanitize-html 1.20.1 +// Type definitions for sanitize-html 1.22.0 // Project: https://github.com/punkave/sanitize-html // Definitions by: Rogier Schouten // Afshin Darian @@ -9,6 +9,7 @@ // Johan Davidsson // Jianrong Yu // GP +// tomotetra // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -31,6 +32,8 @@ declare namespace sanitize { type AllowedAttribute = string | { name: string; multiple?: boolean; values: string[] }; + type DisallowedTagsModes = 'discard' | 'escape' | 'recursiveEscape'; + interface IDefaults { allowedAttributes: { [index: string]: AllowedAttribute[] }; allowedSchemes: string[]; @@ -65,6 +68,7 @@ declare namespace sanitize { selfClosing?: string[]; transformTags?: { [tagName: string]: string | Transformer }; parser?: Options; + disallowedTagsMode?: DisallowedTagsModes; } diff --git a/types/sanitize-html/sanitize-html-tests.ts b/types/sanitize-html/sanitize-html-tests.ts index 83a0b076c5..aea5881f2c 100644 --- a/types/sanitize-html/sanitize-html-tests.ts +++ b/types/sanitize-html/sanitize-html-tests.ts @@ -31,7 +31,8 @@ let options: sanitize.IOptions = { allowedSchemesByTag: { 'a': ['http', 'https'] }, - allowProtocolRelative: false + allowProtocolRelative: false, + disallowedTagsMode: 'escape' }; let unsafe = '
';