wip: dark mode - light mode
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { nip19 } from 'nostr-tools';
|
||||
import { EventPointer, ProfilePointer } from 'nostr-tools/lib/nip19';
|
||||
import { AddressPointer, EventPointer, ProfilePointer } from 'nostr-tools/lib/nip19';
|
||||
|
||||
import { RichContent } from '@utils/types';
|
||||
|
||||
@@ -84,7 +84,7 @@ export function parser(eventContent: string) {
|
||||
}
|
||||
|
||||
// nostr account references
|
||||
if (word.startsWith('nostr:note1') || word.startsWith('noté')) {
|
||||
if (word.startsWith('nostr:note1') || word.startsWith('note1')) {
|
||||
const note = word.replace('nostr:', '').replace(/[^a-zA-Z0-9 ]/g, '');
|
||||
content.notes.push(nip19.decode(note).data as string);
|
||||
return word.replace(word, '');
|
||||
@@ -98,6 +98,15 @@ export function parser(eventContent: string) {
|
||||
return word.replace(word, '');
|
||||
}
|
||||
|
||||
// nostr address references
|
||||
if (word.startsWith('nostr:naddr1') || word.startsWith('naddr1')) {
|
||||
const naddr = word.replace('nostr:', '').replace(/[^a-zA-Z0-9 ]/g, '');
|
||||
const decoded = nip19.decode(naddr).data as AddressPointer;
|
||||
// TODO
|
||||
console.log('todo: ', decoded);
|
||||
return word.replace(word, '');
|
||||
}
|
||||
|
||||
// normal word
|
||||
return word;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user