fedimbed: cleaner quote nested quote

This commit is contained in:
Cynthia Foxwell 2025-04-18 21:54:23 -06:00
parent 18f408ca6b
commit 5514ff2778
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -1289,11 +1289,18 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote =
let quoteRes; let quoteRes;
if (platformName == "Nitter") { if (platformName == "Nitter") {
const quote = content.match(/<blockquote><b>↘ <a href="([^"]+?)">/); const quote = content.match(/<blockquote><b>↘ <a href="([^"]+?)">/);
if (quote?.[1] && !inQuote) { if (quote?.[1]) {
const quoteUrl = quote[1]; const quoteUrl = quote[1];
content = content.replace(/<blockquote><b>↘ <a href="[^"]+?">.+?<\/blockquote>/, ""); content = content.replace(
/<blockquote><b>↘ <a href="[^"]+?">(.+?)<\/a>.+?<\/blockquote>/,
!inQuote
? ""
: `<small>${Icons.fedimbed.quote
.replace("<", "&lt;")
.replace(">", "&gt;")} Quoting <a href="${quoteUrl}">$1</a></small>`
);
quoteRes = await processUrl(msg, quoteUrl, spoiler, command, true); if (!inQuote) quoteRes = await processUrl(msg, quoteUrl, spoiler, command, true);
} }
content = content content = content