fix(catalog): greentext and markdown styling shouldn't appear

This commit is contained in:
Tom (plebeius.eth)
2024-09-17 17:03:59 +02:00
parent 8c91219134
commit 7742e1c9b0
3 changed files with 18 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
export { default } from './popular-threads-box';
export { default, ContentPreview } from './popular-threads-box';
@@ -18,7 +18,7 @@ interface PopularThreadProps {
boardShortAddress: string;
}
const ContentPreview = ({ content, maxLength = 99 }: { content: string; maxLength?: number }) => {
export const ContentPreview = ({ content, maxLength = 99 }: { content: string; maxLength?: number }) => {
const plainText = removeMarkdown(content).trim().replaceAll(' ', '').replace(/\n\n/g, '\n').replaceAll('\n\n', '');
const truncatedText = plainText.length > maxLength ? `${plainText.substring(0, maxLength).trim()}...` : plainText;