Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions orbit-app/src/components/CommentsSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,16 @@ function CommentsSection() {
</form>

<div className="comments-list">
{commentsList.map((cmt, index) => (
<div key={index} dangerouslySetInnerHTML={{ __html: cmt.comment }} />
))}
(cmt, index) => (
<div key={index}>
{sanitizeHTML(cmt.comment)}
</div>
)

// Ensure to use a robust HTML sanitization library, such as DOMPurify, to clean the input before rendering it into the DOM.
// Example:
// import DOMPurify from 'dompurify';
// const sanitizeHTML = (html) => DOMPurify.sanitize(html);
</div>
</div>
);
Expand Down