mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix js void warning
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"react-toastify": "9.1.1",
|
"react-toastify": "9.1.1",
|
||||||
"react-tooltip": "5.10.0",
|
"react-tooltip": "5.10.0",
|
||||||
|
"rehype-sanitize": "^5.0.1",
|
||||||
"remark-breaks": "3.0.2",
|
"remark-breaks": "3.0.2",
|
||||||
"styled-components": "5.3.9",
|
"styled-components": "5.3.9",
|
||||||
"web-vitals": "3.3.0",
|
"web-vitals": "3.3.0",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactMarkdown from 'react-markdown';
|
import ReactMarkdown from 'react-markdown';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import DOMPurify from 'dompurify';
|
import rehypeSanitize from 'rehype-sanitize';
|
||||||
import breaks from 'remark-breaks';
|
import breaks from 'remark-breaks';
|
||||||
|
|
||||||
|
|
||||||
@@ -54,12 +54,12 @@ const createQuotelink = (handlequoteclick, comment, children) => {
|
|||||||
|
|
||||||
const Post = ({ content, handlequoteclick, comment }) => {
|
const Post = ({ content, handlequoteclick, comment }) => {
|
||||||
const doubleNewlineContent = content?.replaceAll(/\n(?!\n)/g, '\n\n');
|
const doubleNewlineContent = content?.replaceAll(/\n(?!\n)/g, '\n\n');
|
||||||
const sanitizedContent = DOMPurify.sanitize(doubleNewlineContent);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ReactMarkdown
|
<ReactMarkdown
|
||||||
children={sanitizedContent}
|
children={doubleNewlineContent}
|
||||||
remarkPlugins={[blockquoteToGreentext, breaks]}
|
remarkPlugins={[blockquoteToGreentext, breaks]}
|
||||||
|
rehypePlugins={[rehypeSanitize]}
|
||||||
components={{
|
components={{
|
||||||
img: () => null,
|
img: () => null,
|
||||||
video: () => null,
|
video: () => null,
|
||||||
|
|||||||
Reference in New Issue
Block a user