small fixes and support $ boost sign

This commit is contained in:
Ren Amamiya
2023-09-28 07:29:05 +07:00
parent 7cef6efa6f
commit c80414a72d
8 changed files with 31 additions and 38 deletions

View File

@@ -57,6 +57,11 @@ export function parser(eventContent: string) {
return word.replace(word, `~tag-${word}~`);
}
// boost
if (word.startsWith('$') && word.length > 1) {
return word.replace(word, `~boost-${word}~`);
}
// nostr account references
if (word.startsWith('nostr:npub1') || word.startsWith('npub1')) {
const npub = word.replace('nostr:', '').replace(/[^a-zA-Z0-9 ]/g, '');