fix: add renderImage and renderLink for SingleReplyBox.js (#511)

This commit is contained in:
Nekotoxin 2022-05-05 22:40:16 +08:00 committed by GitHub
parent 0937908930
commit 3d8d99de55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -21,6 +21,7 @@ import Avatar from "../Avatar";
import ReactMarkdown from "react-markdown";
import UserLink from "../UserLink";
import { Helmet } from "react-helmet";
import Zmage from "react-zmage";
class SingleReplyBox extends React.Component {
constructor(props) {
@ -53,6 +54,14 @@ class SingleReplyBox extends React.Component {
});
}
renderImage = ({ alt, src }) => {
return <Zmage src={src} alt={alt} />;
};
renderLink = (props) => {
return <a {...props} target="_blank" rel="nofollow noopener noreferrer" />;
};
renderSingleReplyBox(reply) {
return (
<div id={`r_${reply.id}`}>