From 2725c0809fe13e1b55b5c457548f5998d595e91e Mon Sep 17 00:00:00 2001
From: yzqzss <30341059+yzqzss@users.noreply.github.com>
Date: Sat, 17 Feb 2024 02:56:06 +0000
Subject: [PATCH] fix: `dangerouslySetInnerHTML` for `author`
---
src/components/PostCard.tsx | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/components/PostCard.tsx b/src/components/PostCard.tsx
index 81fac5f..a760938 100644
--- a/src/components/PostCard.tsx
+++ b/src/components/PostCard.tsx
@@ -10,6 +10,7 @@ import { useLocation } from 'react-router-dom';
import type { Post } from '../api/types';
import { PRIMARY_COLOR } from '../constant';
+// TODO: 不知道咋把 post.author.slice(1) 插进 HTML,暂时把 span 去掉
const PostCard = ({ post }: { post: Post }) => {
const location = useLocation();
const params = new URLSearchParams(location.search);
@@ -18,13 +19,23 @@ const PostCard = ({ post }: { post: Post }) => {