Skip to content

Commit

Permalink
fix: no style on views
Browse files Browse the repository at this point in the history
  • Loading branch information
clovis committed Jun 3, 2024
1 parent e0d1d8a commit 886a7e8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
.yarn
21 changes: 16 additions & 5 deletions template/src/sanitize.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
import xss from 'xss';

const allowed = ["class"];

// @ts-expect-error no types
const whiteList = Object.keys(xss.whiteList).reduce((acc, key) => {
// @ts-expect-error no types
const value = [...xss.whiteList[key], ...allowed];
return {
...acc,
[key]: value,
}
}, {});

const options = {
whiteList: {
// @ts-expect-error no types
...xss.whiteList,
main: [],
svg: [],
time: [],
...whiteList,
main: allowed,
svg: allowed,
time: allowed,
}
}

Expand Down

0 comments on commit 886a7e8

Please sign in to comment.