FEATURE: used strict sanitizer by default
This amends it so sanitize always uses the most strict sanitizer by default, if it needs to be "widened" to use more options then you need to pass it more options.
This commit is contained in:
parent
ecec23fae4
commit
81eb3218b2
|
@ -33,8 +33,8 @@ export function cookAsync(text, options) {
|
|||
}
|
||||
|
||||
|
||||
export function sanitize(text) {
|
||||
return textSanitize(text, new WhiteLister(getOpts()));
|
||||
export function sanitize(text, options) {
|
||||
return textSanitize(text, new WhiteLister(options));
|
||||
}
|
||||
|
||||
function emojiOptions() {
|
||||
|
|
|
@ -14,12 +14,18 @@ function concatUniq(src, elems) {
|
|||
|
||||
export default class WhiteLister {
|
||||
constructor(options) {
|
||||
options = options || {
|
||||
features: {
|
||||
default: true
|
||||
}
|
||||
};
|
||||
|
||||
options.features.default = true;
|
||||
|
||||
this._featureKeys = Object.keys(options.features).filter(f => options.features[f]);
|
||||
this._key = this._featureKeys.join(':');
|
||||
this._features = options.features;
|
||||
this._options = options||{};
|
||||
this._options = {};
|
||||
}
|
||||
|
||||
getCustom() {
|
||||
|
|
Loading…
Reference in New Issue