nostr-tools does a decent job with that but I'm additionally handling lots of malformed edge cases, broken nip27s, old nip08. I think it can be very useful. Also support basic markdown with nano-markdown
Discussion
Yes, but would be nice to have it like a separate library for modularity and convenience in the maintenance, edge cases, etc...