mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
🤖 Merge PR #45796 [sanitize-html] fix IOptions["allowedClasses"] type by @JoelWee
The source code does not support setting boolean to allowedClasses. It only supports this for individual tags in allowedClasses. E.g. { p: false } will allow all classes for the p tag.
This commit is contained in:
parent
5e72001c2a
commit
607b7f1b4e
2
types/sanitize-html/index.d.ts
vendored
2
types/sanitize-html/index.d.ts
vendored
@ -57,7 +57,7 @@ declare namespace sanitize {
|
||||
interface IOptions {
|
||||
allowedAttributes?: { [index: string]: AllowedAttribute[] } | boolean;
|
||||
allowedStyles?: { [index: string]: { [index: string]: RegExp[] } };
|
||||
allowedClasses?: { [index: string]: string[] } | boolean;
|
||||
allowedClasses?: { [index: string]: string[] | boolean };
|
||||
allowedIframeHostnames?: string[];
|
||||
allowIframeRelativeUrls?: boolean;
|
||||
allowedSchemes?: string[] | boolean;
|
||||
|
||||
@ -6,6 +6,10 @@ let options: sanitize.IOptions = {
|
||||
'a': sanitize.defaults.allowedAttributes['a'].concat('rel'),
|
||||
'img': ['src', 'height', 'width', 'alt', 'style']
|
||||
},
|
||||
allowedClasses: {
|
||||
a: ['className'],
|
||||
p: false,
|
||||
},
|
||||
allowedStyles: {
|
||||
'*': {
|
||||
color: [/^red$/],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user