diff --git a/apps/frontend/src/components/launches/general.preview.component.tsx b/apps/frontend/src/components/launches/general.preview.component.tsx index f4a74c63..51ff2ac8 100644 --- a/apps/frontend/src/components/launches/general.preview.component.tsx +++ b/apps/frontend/src/components/launches/general.preview.component.tsx @@ -17,13 +17,7 @@ export const GeneralPreviewComponent: FC<{ const mediaDir = useMediaDirectory(); const renderContent = topValue.map((p) => { - const newContent = stripHtmlValidation('html', p.content, true) - .replace(/(@.+?)(\s)/gi, (match, match1, match2) => { - return `${match1.trim()}${match2}`; - }) - .replace(/@\[(.+?)]\((.+?)\)/gi, (match, name, id) => { - return `@${name}`; - }); + const newContent = stripHtmlValidation('normal', p.content, true); const { start, end } = textSlicer( integration?.identifier || '', @@ -32,14 +26,30 @@ export const GeneralPreviewComponent: FC<{ ); const finalValue = - newContent.slice(start, end) + + newContent + .slice(start, end) + .replace(/(@.+?)(\s)/gi, (match, match1, match2) => { + return `${match1.trim()}${match2}`; + }) + .replace(/@\[(.+?)]\((.+?)\)/gi, (match, name, id) => { + return `@${name}`; + }) + `` + - newContent.slice(end) + + newContent + .slice(end) + .replace(/(@.+?)(\s)/gi, (match, match1, match2) => { + return `${match1.trim()}${match2}`; + }) + .replace(/@\[(.+?)]\((.+?)\)/gi, (match, name, id) => { + return `@${name}`; + }) + ``; return { text: finalValue, images: p.image }; }); + console.log(renderContent); + return (