Skip to content

Commit

Permalink
feat: sanitize-html
Browse files Browse the repository at this point in the history
  • Loading branch information
lhbxs committed Oct 24, 2023
1 parent 8d33076 commit 8b34e74
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,5 @@
},
"resolutions": {
"types-ramda": "0.29.4"
}
}
}
6 changes: 2 additions & 4 deletions packages/form-render/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,11 @@
"rc-color-picker": "^1.2.6",
"virtualizedtableforantd4": "^1.1.2",
"zustand": "^4.1.5",
"ahooks": "^3.7.5",
"sanitize-html": "^2.10.0"
"ahooks": "^3.7.5"
},
"devDependencies": {
"deep-equal": "^2.0.3",
"rollup-plugin-copy": "^3.4.0",
"@types/sanitize-html": "^2.9.0"
"rollup-plugin-copy": "^3.4.0"
},
"peerDependencies": {
"antd": "4.x || 5.x",
Expand Down
4 changes: 0 additions & 4 deletions packages/form-render/src/widgets/fields/html/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { Image } from 'antd';
import sanitizeHtml from 'sanitize-html';

export default function html({ value, options, schema = {} } : any) {
let __html = '-';
Expand Down Expand Up @@ -47,8 +46,5 @@ export default function html({ value, options, schema = {} } : any) {
/>
);
}

__html = sanitizeHtml(__html)

return <div dangerouslySetInnerHTML={{ __html }} />;
}

0 comments on commit 8b34e74

Please sign in to comment.