diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2025-03-24 13:59:28 -0400 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-03-27 19:51:43 -0400 |
| commit | 8a9979b3d305e9ec85d89efea0aca8cf98a32eae (patch) | |
| tree | 77e99260dbcabdb4cba8a7e9e6d16781d79f1076 /packages/backend/src/server/api | |
| parent | fix reaction emoji mapping in mastodon API (diff) | |
| download | sharkey-8a9979b3d305e9ec85d89efea0aca8cf98a32eae.tar.gz sharkey-8a9979b3d305e9ec85d89efea0aca8cf98a32eae.tar.bz2 sharkey-8a9979b3d305e9ec85d89efea0aca8cf98a32eae.zip | |
don't render CW as HTML for mastodon
Diffstat (limited to 'packages/backend/src/server/api')
| -rw-r--r-- | packages/backend/src/server/api/mastodon/MastodonConverters.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/packages/backend/src/server/api/mastodon/MastodonConverters.ts b/packages/backend/src/server/api/mastodon/MastodonConverters.ts index 2fbbbbb7af..7a1387e4aa 100644 --- a/packages/backend/src/server/api/mastodon/MastodonConverters.ts +++ b/packages/backend/src/server/api/mastodon/MastodonConverters.ts @@ -222,8 +222,7 @@ export class MastodonConverters { // TODO avoid re-packing files for each edit const files = await this.driveFileEntityService.packManyByIds(edit.fileIds); - const cwMFM = appendContentWarning(edit.cw, noteUser.mandatoryCW); - const cw = (cwMFM && this.mfmService.toMastoApiHtml(mfm.parse(cwMFM), mentionedRemoteUsers, true)) ?? ''; + const cw = appendContentWarning(edit.cw, noteUser.mandatoryCW) ?? ''; const isQuote = renote && (edit.cw || edit.newText || edit.fileIds.length > 0 || note.replyId); const quoteUri = isQuote @@ -298,8 +297,7 @@ export class MastodonConverters { ? quoteUri.then(quote => this.mfmService.toMastoApiHtml(mfm.parse(text), mentionedRemoteUsers, false, quote) ?? escapeMFM(text)) : ''; - const cwMFM = appendContentWarning(note.cw, noteUser.mandatoryCW); - const cw = (cwMFM && this.mfmService.toMastoApiHtml(mfm.parse(cwMFM), mentionedRemoteUsers, true)) ?? ''; + const cw = appendContentWarning(note.cw, noteUser.mandatoryCW) ?? ''; const reblogged = await this.mastodonDataService.hasReblog(note.id, me); |