db97a39133
Check Cross-Plugin Imports / check (push) Has been cancelled
- P1-Tests: 12 test files with new cross-tenant isolation + RBAC tests - P3-Tests: 8 fixes (duplicate fixtures, sys.path.insert, unused imports, KeyError) - P3-Frontend: LucideIcons → ICON_MAP (2 files), inline styles → Tailwind (2 files) - P3-Frontend: DOMPurify for iframe XSS, redundant regex removed, console.log → console.debug - P2-Frontend: 2 notification API TODOs retained (requires larger refactor) - conftest.py: create_no_perm_user helper added - pyproject.toml: pythonpath for scripts/ added - All checks green: ruff 0, F821 0, tsc 0, app 495 routes, cross-plugin 0
27 lines
551 B
TypeScript
27 lines
551 B
TypeScript
import React from 'react';
|
|
import DOMPurify from 'dompurify';
|
|
import type { MessageBlock } from '@/store/commStore';
|
|
|
|
interface HtmlBlockProps {
|
|
block: MessageBlock;
|
|
}
|
|
|
|
const HtmlBlock: React.FC<HtmlBlockProps> = ({ block }) => {
|
|
const rawHtml: string = block.block_data.html || '';
|
|
|
|
if (!rawHtml) {
|
|
return null;
|
|
}
|
|
|
|
const sanitized = DOMPurify.sanitize(rawHtml);
|
|
|
|
return (
|
|
<div
|
|
className="prose prose-sm max-w-none text-inherit"
|
|
dangerouslySetInnerHTML={{ __html: sanitized }}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default HtmlBlock;
|