Raw HTML rendered as text in Notifications Dropdown
Description
Notifications in the dropdown display raw HTML (e.g., <h2>, <p>, <a>) instead of properly rendered content.
Expected Behavior
HTML content should be parsed and displayed as formatted text with styling and clickable links.
Actual Behavior
HTML is escaped and shown as plain text.
Root Cause
ReactMarkdown escapes HTML by default, while the backend is sending HTML instead of Markdown.
Suggested Fix
Enable HTML rendering using rehype-raw:
import rehypeRaw from "rehype-raw";
<ReactMarkdown rehypePlugins={[rehypeRaw]}>
{notif?.body}
</ReactMarkdown>
Steps to Reproduce
Open Notifications dropdown
View system notifications
Observe raw HTML displayed
Notes
If enabling rehype-raw, ensure content is trusted to avoid XSS risks.
I would like to work on this issue. Please assign it to me if approved.
whats the difference between this and the fix made in #3350
Hi @IshaanXCoder, I think both are the same, but the bug is still present.
You can see the change by building the develop branch.
thanks @IshaanXCoder for pointing this out