Skip to content

Text Content

Parsing content

The getParsedContent method can be used to parse and transform an event into the content syntax tree

Cashing

Because parsing and transforming content is an expensive operation getParsedContent method will cache the results on the event under a Symbol, by default this is the TextNoteContentSymbol

If your parsing or transforming different event kinds than kind 1, its recommended to create a new Symbol to and pass to getParsedContent to avoid cache collisions with the default kind 1 processor

The links transformer can be used to parse URLs and add Link nodes to the tree

Mentions

The nostrMentions transformer can be used to add Mention nodes to the tree

Hashtags

The hashtags transformer can be used to add Hashtag nodes to the tree

Emojis

The emojis transformer will add Emoji tags for any NIP-30 emojis

Galleries

The galleries transformer will group image URLs into a Gallery node

Lightning invoices

The lightningInvoices transformer can be used to parse bolt11 lightning invoices in the content

Cashu tokens and payment requests

The cashuTokens transformer can be used to parse cashu tokens in the content