fix(notes): limit, add new line split, remove links split
All checks were successful
Release to Staging / build_and_release (push) Successful in 1m7s
All checks were successful
Release to Staging / build_and_release (push) Successful in 1m7s
This commit is contained in:
parent
4ea00d1af6
commit
700e2e1e4e
@ -18,13 +18,13 @@ export const useTextLimit = (
|
|||||||
filteredText: string
|
filteredText: string
|
||||||
indices: number[]
|
indices: number[]
|
||||||
} => {
|
} => {
|
||||||
const words = text.split(' ')
|
const words = text.split(/[\s\n]+/)
|
||||||
const filteredWords: string[] = []
|
const filteredWords: string[] = []
|
||||||
const indices: number[] = []
|
const indices: number[] = []
|
||||||
let currentIndex = 0
|
let currentIndex = 0
|
||||||
|
|
||||||
words.forEach((word) => {
|
words.forEach((word) => {
|
||||||
if (!word.startsWith('nostr:')) {
|
if (!(word.startsWith('nostr:') || word.startsWith('http'))) {
|
||||||
filteredWords.push(word)
|
filteredWords.push(word)
|
||||||
indices.push(currentIndex)
|
indices.push(currentIndex)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user