migration wip

This commit is contained in:
2025-12-30 00:06:54 +01:00
parent 3efbac78cb
commit 89dbf8af87
94 changed files with 5674 additions and 308 deletions

View File

@@ -2,7 +2,7 @@ import React from 'react';
import Image from 'next/image';
import Link from 'next/link';
import { cn } from '../../lib/utils';
import { processHTML } from '../../lib/html-compat';
import { processHTML, processShortcodes } from '../../lib/html-compat';
import { getMediaByUrl, getMediaById, getAssetMap } from '../../lib/data';
interface ContentRendererProps {
@@ -35,19 +35,25 @@ export const ContentRenderer: React.FC<ContentRendererProps> = ({
// Process the HTML content
const processedContent = React.useMemo(() => {
let html = content;
// Check for raw shortcodes and force processing if detected
const shortcodeRegex = /\[[^\]]*\]/;
if (shortcodeRegex.test(html)) {
html = processShortcodes(html);
}
if (sanitize) {
html = processHTML(html);
}
if (processAssets) {
html = replaceWordPressAssets(html);
}
if (convertClasses) {
html = convertWordPressClasses(html);
}
return html;
}, [content, sanitize, processAssets, convertClasses]);