I didn't even mean to do this, but this is what happens when you use the same code to render notes everywhere — you can now (soon) embed notes in chats/dms and open them in a modal! Ridiculously cool, and totally accidental.

https://us-southeast-1.linodeobjects.com/dufflepud/uploads/bbca8f56-83ca-4023-9ce2-528a571002f5.mov

Reply to this note

Please Login to reply.

Discussion

Sweet!

yeah - adding a modal webview to the damus desktop app would be legit (as well as mobile)

I'm surprised Nostr doesn't have something universal yet for:

A javascript library that renders an event’s content. It can replace mentions, convert links to http, markup hashtags, render images, embed media like YouTube, twitch, etc, and maybe even embed a reference Nostr event. It could support stripping out unsafe javascript too. Similar to a markdown to HTML render library.

Is the render code standalone, or internal to C?

It's internal, but could be pulled out. The problem I think is that it's hard to disentangle what is specific to a client vs what can be shared. For example coracle's embeds use coracle's badge generation, fonts, colors, borders, etc. Component libraries that are fully customizable are a lot of work.

Now, that said, I do have a parsing function now that could be very useful, as it simply returns an array of classified note parts.

Nice work

bonus 💯