diff --git a/app/assets/javascripts/discourse/lib/text.js.es6 b/app/assets/javascripts/discourse/lib/text.js.es6 index 172e4ac7d33..476ca3ea9ec 100644 --- a/app/assets/javascripts/discourse/lib/text.js.es6 +++ b/app/assets/javascripts/discourse/lib/text.js.es6 @@ -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() { diff --git a/app/assets/javascripts/pretty-text/white-lister.js.es6 b/app/assets/javascripts/pretty-text/white-lister.js.es6 index b48131f71e6..8c37cbd4798 100644 --- a/app/assets/javascripts/pretty-text/white-lister.js.es6 +++ b/app/assets/javascripts/pretty-text/white-lister.js.es6 @@ -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() {