migration wip

This commit is contained in:
2025-12-29 18:45:02 +01:00
parent f86785bfb0
commit 3efbac78cb
33 changed files with 164 additions and 52 deletions

View File

@@ -89,8 +89,16 @@ export const ContentRenderer: React.FC<ContentRendererProps> = ({
/**
* Parse HTML string to React elements
* This is a safe parser that only allows specific tags and attributes
* Works in both server and client environments
*/
function parseHTMLToReact(html: string): React.ReactNode {
// For server-side rendering, use a simple approach with dangerouslySetInnerHTML
// The HTML has already been sanitized by processHTML, so it's safe
if (typeof window === 'undefined') {
return <div dangerouslySetInnerHTML={{ __html: html }} />;
}
// Client-side: use DOMParser for proper parsing
// Define allowed tags and their properties
const allowedTags = {
div: ['className', 'id', 'style'],