diff --git a/megalodon/src/misskey/api_client.ts b/megalodon/src/misskey/api_client.ts
index ba27f49..10b43e7 100644
--- a/megalodon/src/misskey/api_client.ts
+++ b/megalodon/src/misskey/api_client.ts
@@ -42,6 +42,16 @@ namespace MisskeyAPI {
}
export namespace Converter {
+ // FIXME: Properly render MFM instead of just escaping HTML characters.
+ const escapeMFM = (text: string): string => text
+ .replace(/&/g, '&')
+ .replace(//g, '>')
+ .replace(/"/g, '"')
+ .replace(/'/g, ''')
+ .replace(/`/g, '`')
+ .replace(/\r?\n/g, '
');
+
export const emoji = (e: Entity.Emoji): MegalodonEntity.Emoji => {
return {
shortcode: e.name,
@@ -229,16 +239,7 @@ namespace MisskeyAPI {
in_reply_to_id: n.replyId,
in_reply_to_account_id: n.reply?.userId ?? null,
reblog: n.renote ? note(n.renote, host) : null,
- content: n.text
- ? n.text
- .replace(/&/g, '&')
- .replace(//g, '>')
- .replace(/"/g, '"')
- .replace(/'/g, ''')
- .replace(/`/g, '`')
- .replace(/\r?\n/g, '
')
- : '',
+ content: n.text ? escapeMFM(n.text) : '',
plain_content: n.text ? n.text : null,
created_at: n.createdAt,
emojis: n.emojis.map(e => emoji(e)),
@@ -385,33 +386,22 @@ namespace MisskeyAPI {
moved: null
}
- export const announcement = (a: Entity.Announcement): MegalodonEntity.Announcement => {
- // Reused from Note converter.
- const escapeHTML = (text: string) => text
- .replace(/&/g, '&')
- .replace(//g, '>')
- .replace(/"/g, '"')
- .replace(/'/g, ''')
- .replace(/`/g, '`')
- .replace(/\r?\n/g, '
');
- return {
- id: a.id,
- content: `