move ExternalPointer to nip73 and write nip27.Parse() that gets all the parts of the text including URLs, Nostr URIs and just raw text.

This commit is contained in:
fiatjaf
2025-03-21 23:43:23 -03:00
parent 3ebfc7812b
commit e18528c043
6 changed files with 232 additions and 22 deletions

View File

@@ -17,6 +17,7 @@ type Reference struct {
var mentionRegex = regexp.MustCompile(`\bnostr:((note|npub|naddr|nevent|nprofile)1\w+)\b`)
// Deprecated: this is useless, use Parse() isntead (but the semantics is different)
func ParseReferences(evt nostr.Event) iter.Seq[Reference] {
return func(yield func(Reference) bool) {
for _, ref := range mentionRegex.FindAllStringSubmatchIndex(evt.Content, -1) {