Fix event mention bug (#421)

* only replace valid note IDs

* render empty string if no ref.Event
This commit is contained in:
Sam Samskies
2023-03-10 06:08:59 -10:00
committed by GitHub
parent 1357b7a903
commit 3dccf21d2c
2 changed files with 5 additions and 3 deletions

View File

@ -76,7 +76,7 @@ export default function useEventPublisher() {
};
const content = msg
.replace(/@npub[a-z0-9]+/g, replaceNpub)
.replace(/note[a-z0-9]+/g, replaceNoteId)
.replace(/note1[acdefghjklmnpqrstuvwxyz023456789]{58}/g, replaceNoteId)
.replace(HashtagRegex, replaceHashtag);
ev.Content = content;
}