feat(task-comments): enhance comment processing with linkification and sanitization

- Added a utility to linkify URLs in comments, allowing users to click and open links.
- Refactored comment content processing to handle both mentions and links, improving user interaction.
- Updated the sanitizeHtml function to allow <span> tags for mentions, enhancing content display.
This commit is contained in:
shancds
2025-06-19 13:23:40 +05:30
parent b47b3253f6
commit ece614941e
2 changed files with 35 additions and 8 deletions

View File

@@ -29,7 +29,7 @@ export const sanitizeHtml = (input: string): string => {
if (!input) return '';
return DOMPurify.sanitize(input, {
ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'a', 'p', 'br'],
ALLOWED_ATTR: ['href', 'target', 'rel'],
ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'a', 'p', 'br', 'span'],
ALLOWED_ATTR: ['href', 'target', 'rel', 'class'],
});
};