From 45a11d45fc2cd09943934b52bd8bef155306fa65 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 15 May 2025 12:01:45 -0400 Subject: [PATCH] fix: #13419, handle remote content with mediaType text/markdown --- src/activitypub/mocks.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/activitypub/mocks.js b/src/activitypub/mocks.js index f2a8446d4a..fee85cd6bd 100644 --- a/src/activitypub/mocks.js +++ b/src/activitypub/mocks.js @@ -42,7 +42,7 @@ const sanitizeConfig = { Mocks._normalize = async (object) => { // Normalized incoming AP objects into expected types for easier mocking - let { type, attributedTo, url, image, content, source, attachment } = object; + let { type, attributedTo, url, image, mediaType, content, source, attachment } = object; switch (true) { // non-string attributedTo handling case Array.isArray(attributedTo): { @@ -70,6 +70,9 @@ Mocks._normalize = async (object) => { if (sourceContent) { content = null; sourceContent = await activitypub.helpers.remoteAnchorToLocalProfile(sourceContent, true); + } else if (mediaType === 'text/markdown') { + sourceContent = await activitypub.helpers.remoteAnchorToLocalProfile(content, true); + content = null; } else if (content && content.length) { content = sanitize(content, sanitizeConfig); content = await activitypub.helpers.remoteAnchorToLocalProfile(content);