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 = '
';