Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Commit 676f232

Browse files
Fix ReactMarkdown disallowed elements
The AI fixed an error in `src/pages/NewsDetail.tsx` where both `allowedElements` and `disallowedElements` were used simultaneously in the `ReactMarkdown` component, which is not permitted. It will resolve this by removing `disallowedElements` and relying solely on `allowedElements` to ensure proper markdown rendering.
1 parent 6d159b6 commit 676f232

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/pages/NewsDetail.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ const NewsDetail = () => {
6565
{newsItem.content && (
6666
<div className="prose prose-blue max-w-none prose-headings:text-blue-700 prose-a:text-blue-600 prose-strong:text-blue-600">
6767
<ReactMarkdown
68-
allowedElements={['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'strong', 'em', 'ul', 'ol', 'li', 'a', 'blockquote', 'code', 'pre']}
69-
disallowedElements={['script', 'iframe', 'object', 'embed']}
68+
allowedElements={['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'strong', 'em', 'ul', 'ol', 'li', 'a', 'blockquote', 'code', 'pre', 'br']}
7069
>
7170
{newsItem.content}
7271
</ReactMarkdown>

0 commit comments

Comments
 (0)