mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-08-23 20:22:06 +02:00
nip27: fix for contents that end in broken strings.
This commit is contained in:
@@ -78,7 +78,7 @@ func Parse(content string) iter.Seq[Block] {
|
||||
index = end
|
||||
prevIndex = index
|
||||
continue
|
||||
case (u >= 5 && content[u-5:u] == "https") || (u >= 4 && content[u-4:u] == "http"):
|
||||
case ((u >= 5 && content[u-5:u] == "https") || (u >= 4 && content[u-4:u] == "http")) && u+4 < max:
|
||||
m := noURLCharacter.FindStringIndex(content[u+4:])
|
||||
end := max
|
||||
if m != nil {
|
||||
@@ -108,7 +108,7 @@ func Parse(content string) iter.Seq[Block] {
|
||||
index = end
|
||||
prevIndex = index
|
||||
continue
|
||||
case (u >= 3 && content[u-3:u] == "wss") || (u >= 2 && content[u-2:u] == "ws"):
|
||||
case ((u >= 3 && content[u-3:u] == "wss") || (u >= 2 && content[u-2:u] == "ws")) && u+4 < max:
|
||||
m := noURLCharacter.FindStringIndex(content[u+4:])
|
||||
end := max
|
||||
if m != nil {
|
||||
|
Reference in New Issue
Block a user