@ -22,7 +22,8 @@
|
||||
"argsIgnorePattern": "^_",
|
||||
"varsIgnorePattern": "^_"
|
||||
}
|
||||
]
|
||||
],
|
||||
"no-shadow": "off"
|
||||
},
|
||||
"settings": {
|
||||
"jsx-a11y": {
|
||||
|
||||
@ -43,6 +43,7 @@
|
||||
"no-unsafe-type-assertion": "warn",
|
||||
"require-array-sort-compare": "off",
|
||||
"unbound-method": "warn",
|
||||
"no-shadow": "off",
|
||||
|
||||
"formatjs/enforce-default-message": "error",
|
||||
"formatjs/enforce-id": "error",
|
||||
|
||||
@ -6,7 +6,7 @@ import parse, {
|
||||
domToReact,
|
||||
type DOMNode,
|
||||
} from 'html-react-parser';
|
||||
import DOMPurify from 'isomorphic-dompurify';
|
||||
import { sanitize } from 'isomorphic-dompurify';
|
||||
import groupBy from 'lodash/groupBy';
|
||||
import minBy from 'lodash/minBy';
|
||||
import React from 'react';
|
||||
@ -353,7 +353,7 @@ function parseContent(
|
||||
};
|
||||
|
||||
let content = parse(
|
||||
DOMPurify.sanitize(html, { ADD_ATTR: ['target'], USE_PROFILES: { html: true } }),
|
||||
sanitize(html, { ADD_ATTR: ['target'], USE_PROFILES: { html: true } }),
|
||||
options,
|
||||
);
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Link } from '@tanstack/react-router';
|
||||
import clsx from 'clsx';
|
||||
import DOMPurify from 'isomorphic-dompurify';
|
||||
import { sanitize } from 'isomorphic-dompurify';
|
||||
import {
|
||||
type MediaAttachment,
|
||||
type PreviewCard as CardEntity,
|
||||
@ -65,7 +65,7 @@ interface IPreviewCardVideo {
|
||||
|
||||
const PreviewCardVideo: React.FC<IPreviewCardVideo> = React.memo(
|
||||
React.forwardRef<HTMLDivElement, IPreviewCardVideo>(({ card }, ref) => {
|
||||
const html = DOMPurify.sanitize(handleIframeUrl(card.html, card.url, card.provider_name), {
|
||||
const html = sanitize(handleIframeUrl(card.html, card.url, card.provider_name), {
|
||||
ADD_TAGS: ['iframe'],
|
||||
ADD_ATTR: ['allow', 'allowfullscreen', 'referrerpolicy'],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user