mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-07 15:44:22 +01:00
Strip newlines from end of status
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user