only replace note ID when note ID starts with @ character #441

Merged
SamSamskies merged 5 commits from fix-posting-notes-with-note1-nip19-links into main 2023-03-16 01:02:54 +00:00
Showing only changes of commit 87118abf0e - Show all commits

View File

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