diff --git a/src/hooks/useTextLimit.tsx b/src/hooks/useTextLimit.tsx index e6b304b..c4bdb69 100644 --- a/src/hooks/useTextLimit.tsx +++ b/src/hooks/useTextLimit.tsx @@ -18,13 +18,13 @@ export const useTextLimit = ( filteredText: string indices: number[] } => { - const words = text.split(' ') + const words = text.split(/[\s\n]+/) const filteredWords: string[] = [] const indices: number[] = [] let currentIndex = 0 words.forEach((word) => { - if (!word.startsWith('nostr:')) { + if (!(word.startsWith('nostr:') || word.startsWith('http'))) { filteredWords.push(word) indices.push(currentIndex) }