Strip newlines from end of status

This commit is contained in:
Alex Gleason
2024-05-30 12:03:01 -05:00
parent 86b3a51590
commit c0123df79a
2 changed files with 2 additions and 2 deletions

View File

@@ -46,7 +46,7 @@ interface ParsedNoteContent {
/** Convert Nostr content to Mastodon API HTML. Also return parsed data. */
function parseNoteContent(content: string): ParsedNoteContent {
// Parsing twice is ineffecient, but I don't know how to do only once.
const html = linkifyStr(content, linkifyOpts);
const html = linkifyStr(content, linkifyOpts).replace(/\n+$/, '');
const links = linkify.find(content).filter(isLinkURL);
const firstUrl = links.find(isNonMediaLink)?.href;