From 700e2e1e4eb0648ae7f1583c59bda94341794089 Mon Sep 17 00:00:00 2001 From: en Date: Thu, 27 Feb 2025 17:25:50 +0100 Subject: [PATCH] fix(notes): limit, add new line split, remove links split --- src/hooks/useTextLimit.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) }