From 66231a50226096d41997b3939b2671f44205a32b Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Tue, 8 Jul 2025 16:07:59 +0200 Subject: [PATCH] no truncate --- .../ItemPopupComponents/TextPreview.tsx | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/TextPreview.tsx b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/TextPreview.tsx index 77007238..33bfd868 100644 --- a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/TextPreview.tsx +++ b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/TextPreview.tsx @@ -1,23 +1,19 @@ -import truncate from 'markdown-truncate' - import { RichTextEditor } from '#components/Input/RichTextEditor/RichTextEditor' import { fixUrls, mailRegex } from '#utils/ReplaceURLs' import type { Item } from '#types/Item' export const TextPreview = ({ item }: { item: Item }) => { + let replacedText = '' + if (!item.text) return null - else { - let replacedText = truncate(item.text, { limit: 100, ellipsis: true }) as string + else replacedText = fixUrls(item.text) - replacedText = fixUrls(item.text) - - if (replacedText) { - replacedText = replacedText.replace(mailRegex, (url) => { - return `[${url}](mailto:${url})` - }) - } - - return + if (replacedText) { + replacedText = replacedText.replace(mailRegex, (url) => { + return `[${url}](mailto:${url})` + }) } + + return }