mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
34 lines
747 B
TypeScript
34 lines
747 B
TypeScript
/// <reference path="sanitize-html.d.ts" />
|
|
|
|
import sanitizeHtml = require('sanitize-html');
|
|
|
|
var s: string;
|
|
var t: string;
|
|
|
|
t = sanitizeHtml(s);
|
|
t = sanitizeHtml(s, {
|
|
});
|
|
t = sanitizeHtml(s, {
|
|
allowedTags: ["a", "br"],
|
|
allowedSchemes: ["http"],
|
|
allowedAttributes: { "a": ["href"] },
|
|
allowedClasses: { "a": ["someclass"] },
|
|
transformTags: {
|
|
"a": "b",
|
|
"br": function(tagName: string, attributes: {[index: string]: string}): { tagName: string; attributes: {[index: string]: string};} {
|
|
return { tagName: tagName, attributes: attributes };
|
|
}
|
|
},
|
|
exclusiveFilter: {
|
|
"a": function(frame: {
|
|
tag: string;
|
|
attribs: { [index: string]: string };
|
|
text: string;
|
|
tagPosition: number;
|
|
}): boolean {
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
|