Skip to content

Commit

Permalink
Surpress compat issues, for now. To be fixed in #29
Browse files Browse the repository at this point in the history
  • Loading branch information
mozfreddyb committed Aug 23, 2021
1 parent 66b44c8 commit 99fa1b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion demo/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ function fillExample() {
*
*/
function doSanitize() {
/* globals contextSelect */
const context = contextSelect.value;
const inputValue = inputEl.value;
const contextEl = document.createElement(context);
contextEl.setHTML(inputValue, {});
toutEl.value = contextEl.innerHTML;
houtEl.replaceChildren(contextEl);
}

2 changes: 2 additions & 0 deletions src/sanitizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const _normalizeConfig = function _normalizeConfig(config) {

let normalizedConfig = {};
// TODO https://github.com/mozilla/sanitizer-polyfill/issues/29
// eslint-disable-next-line compat/compat
for (let [configurationElementList, elements] of Object.entries(config)) {
if (SUPPORTED_CONFIGURATION_LISTS.has(configurationElementList)) {
normalizedConfig[configurationElementList] = elements.map((element) => {
Expand All @@ -54,6 +55,7 @@ export const _normalizeConfig = function _normalizeConfig(config) {
}

const allowElements =
// eslint-disable-next-line compat/compat
normalizedConfig.allowElements || Array.from(DEFAULT_ALLOWED_ELEMENTS);
const allowAttributes =
normalizedConfig.allowAttributes || DEFAULT_ALLOWED_ATTRIBUTES;
Expand Down

0 comments on commit 99fa1b3

Please sign in to comment.