render profile bios in masto API

This commit is contained in:
Hazelnoot 2025-03-24 13:14:02 -04:00
parent 81f7346f80
commit 36dee5ff20

View file

@ -168,6 +168,9 @@ export class MastodonConverters {
acct = `${user.username}@${user.host}`;
acctUrl = `https://${user.host}/@${user.username}`;
}
const bioText = profile?.description && this.mfmService.toMastoApiHtml(mfm.parse(profile.description));
return awaitAll({
id: account.id,
username: user.username,
@ -179,7 +182,7 @@ export class MastodonConverters {
followers_count: profile?.followersVisibility === 'public' ? user.followersCount : 0,
following_count: profile?.followingVisibility === 'public' ? user.followingCount : 0,
statuses_count: user.notesCount,
note: profile?.description ?? '',
note: bioText ?? '',
url: user.uri ?? acctUrl,
uri: user.uri ?? acctUri,
avatar: user.avatarUrl ?? 'https://dev.joinsharkey.org/static-assets/avatar.png',