From 8abc1fade539a6425db6eecbfc15c152faeabac6 Mon Sep 17 00:00:00 2001 From: Will Gibson Date: Wed, 29 Aug 2018 15:06:33 +0100 Subject: [PATCH] Add parser to sanitize-html's IOptions interface --- types/sanitize-html/index.d.ts | 2 ++ types/sanitize-html/sanitize-html-tests.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/sanitize-html/index.d.ts b/types/sanitize-html/index.d.ts index 2e7527e3fc..8ec8e05901 100644 --- a/types/sanitize-html/index.d.ts +++ b/types/sanitize-html/index.d.ts @@ -4,6 +4,7 @@ // Afshin Darian // BehindTheMath // Rinze de Laat +// Will Gibson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export = sanitize; @@ -51,6 +52,7 @@ declare namespace sanitize { nonTextTags?: string[]; selfClosing?: string[]; transformTags?: { [tagName: string]: string | Transformer }; + parser: {}; } diff --git a/types/sanitize-html/sanitize-html-tests.ts b/types/sanitize-html/sanitize-html-tests.ts index b02a5a6653..51d03bf3fe 100644 --- a/types/sanitize-html/sanitize-html-tests.ts +++ b/types/sanitize-html/sanitize-html-tests.ts @@ -29,7 +29,10 @@ let options: sanitize.IOptions = { allowedSchemesByTag: { 'a': ['http', 'https'] }, - allowProtocolRelative: false + allowProtocolRelative: false, + parser: { + decodeEntities: true + } }; let unsafe = '
';