mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
update sanitize-html typing to 1.22.0 (#43002)
This commit is contained in:
parent
57fe2e635e
commit
06b0334e47
6
types/sanitize-html/index.d.ts
vendored
6
types/sanitize-html/index.d.ts
vendored
@ -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 <https://github.com/rogierschouten>
|
||||
// Afshin Darian <https://github.com/afshin>
|
||||
@ -9,6 +9,7 @@
|
||||
// Johan Davidsson <https://github.com/johandavidson>
|
||||
// Jianrong Yu <https://github.com/YuJianrong>
|
||||
// GP <https://github.com/paambaati>
|
||||
// tomotetra <https://github.com/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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -31,7 +31,8 @@ let options: sanitize.IOptions = {
|
||||
allowedSchemesByTag: {
|
||||
'a': ['http', 'https']
|
||||
},
|
||||
allowProtocolRelative: false
|
||||
allowProtocolRelative: false,
|
||||
disallowedTagsMode: 'escape'
|
||||
};
|
||||
|
||||
let unsafe = '<div><script>alert("hello");</script></div>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user