chore: remove autoplay for audio and video
This commit is contained in:
@@ -19,7 +19,7 @@ interface MarkdownViewerProps {
|
|||||||
|
|
||||||
const dompurifyOptions = {
|
const dompurifyOptions = {
|
||||||
FORBID_TAGS: ['meta', 'style', 'script', 'iframe'],
|
FORBID_TAGS: ['meta', 'style', 'script', 'iframe'],
|
||||||
FORBID_ATTR: ['onerror', 'onclick', 'onload', 'style']
|
FORBID_ATTR: ['onerror', 'onclick', 'onload', 'style', 'autoplay']
|
||||||
};
|
};
|
||||||
|
|
||||||
const cleanHtml = (html: string): string => {
|
const cleanHtml = (html: string): string => {
|
||||||
@@ -81,6 +81,7 @@ const MarkdownViewer: React.FC<MarkdownViewerProps> = ({
|
|||||||
if (token.type === 'script' || token.type === 'style') {
|
if (token.type === 'script' || token.type === 'style') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!reDefineTypes.includes(token.type)) {
|
if (!reDefineTypes.includes(token.type)) {
|
||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
|
|||||||
Reference in New Issue
Block a user