migration wip
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user