From c9b248e23d487993b1d56273bcab1c385bbc62c6 Mon Sep 17 00:00:00 2001 From: Cynthia Date: Sat, 31 Dec 2022 13:02:51 -0700 Subject: [PATCH] fedimbed: try diff way of extracting post id from url --- src/modules/fedimbed.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/fedimbed.js b/src/modules/fedimbed.js index a10b05a..5e1eaf8 100644 --- a/src/modules/fedimbed.js +++ b/src/modules/fedimbed.js @@ -127,7 +127,8 @@ async function processUrl(msg, url) { } else if (PATH_REGEX.mastodon2.test(urlObj.pathname)) { redirUrl = url.replace(/^\/(.+?)\/statuses/, "/api/v1/statuses"); } else if (PATH_REGEX.misskey.test(urlObj.pathname)) { - const noteId = url.match(/^\/notes\/([a-z0-9]+)\/?/)?.[1]; + let noteId = url.split("/notes/")[0] + noteId = noteId.split(noteId.indexOf("/") > -1 ? "/" : "?")[0]; redirUrl = urlObj.origin + "/api/notes/show/"; options.method = "POST"; options.body = JSON.stringify({noteId});