Add parser to sanitize-html's IOptions interface

This commit is contained in:
Will Gibson
2018-08-29 15:20:51 +01:00
parent 3be76f6b28
commit 8abc1fade5
2 changed files with 6 additions and 1 deletions
+2
View File
@@ -4,6 +4,7 @@
// Afshin Darian <https://github.com/afshin>
// BehindTheMath <https://github.com/BehindTheMath>
// Rinze de Laat <https://github.com/biermeester>
// Will Gibson <https://github.com/WillGibson>
// 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: {};
}
+4 -1
View File
@@ -29,7 +29,10 @@ let options: sanitize.IOptions = {
allowedSchemesByTag: {
'a': ['http', 'https']
},
allowProtocolRelative: false
allowProtocolRelative: false,
parser: {
decodeEntities: true
}
};
let unsafe = '<div><script>alert("hello");</script></div>';