Skip to content

Commit

Permalink
[frontend] fix dompurify import
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumejparis committed Dec 20, 2024
1 parent 85d5ad4 commit ab24c68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion openbas-front/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export default [
'import/resolver': 'oxc',
'import/ignore': [
'react-apexcharts', // ignore react-apexcharts as the default export is broken
'dompurify',
],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AttachFileRounded, ExpandLess, ExpandMore } from '@mui/icons-material';
import { Avatar, Button, Card, CardContent, CardHeader, IconButton } from '@mui/material';
import { lightBlue } from '@mui/material/colors';
import { makeStyles, useTheme } from '@mui/styles';
import DOMPurify from 'dompurify';
import purify from 'dompurify';
import parse from 'html-react-parser';
import { useState } from 'react';

Expand Down Expand Up @@ -134,8 +134,8 @@ const Communication = (props) => {
{isHtml ? (
<div style={{ marginTop: -5 }}>
{expand
? parse(DOMPurify.sanitize(content))
: parse(DOMPurify.sanitize(truncate(content, limit)))}
? parse(purify.sanitize(content))
: parse(purify.sanitize(truncate(content, limit)))}
</div>
) : (
<div style={{ marginTop: -5, whiteSpace: 'pre-line' }}>
Expand Down

0 comments on commit ab24c68

Please sign in to comment.