diff --git a/packages/backend/src/server/api/mastodon/converters/user.ts b/packages/backend/src/server/api/mastodon/converters/user.ts index 665b95c02..08f0a252e 100644 --- a/packages/backend/src/server/api/mastodon/converters/user.ts +++ b/packages/backend/src/server/api/mastodon/converters/user.ts @@ -110,7 +110,7 @@ export class UserConverter { private static encodeField(f: Field): MastodonEntity.Field { return { name: f.name, - value: MfmHelpers.toHtml(mfm.parse(f.value)) ?? escapeMFM(f.value), + value: MfmHelpers.toHtml(mfm.parse(f.value), undefined, true) ?? escapeMFM(f.value), verified_at: f.verified ? (new Date()).toISOString() : null, } } diff --git a/packages/backend/src/server/api/mastodon/helpers/mfm.ts b/packages/backend/src/server/api/mastodon/helpers/mfm.ts index 2b4fa2acf..931036e29 100644 --- a/packages/backend/src/server/api/mastodon/helpers/mfm.ts +++ b/packages/backend/src/server/api/mastodon/helpers/mfm.ts @@ -7,7 +7,8 @@ import mfm from "mfm-js"; export class MfmHelpers { public static toHtml( nodes: mfm.MfmNode[] | null, - mentionedRemoteUsers: IMentionedRemoteUsers = [] + mentionedRemoteUsers: IMentionedRemoteUsers = [], + inline: boolean = false ) { if (nodes == null) { return null; @@ -203,6 +204,6 @@ export class MfmHelpers { appendChildren(nodes, doc.body); - return `

${doc.body.innerHTML}

`; + return inline ? doc.body.innerHTML : `

${doc.body.innerHTML}

`; } }