fedimbed: more markdown fixery

This commit is contained in:
Cynthia Foxwell 2025-04-19 14:44:26 -06:00
parent 404253f0c8
commit 31d61af27e
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -1304,9 +1304,9 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote =
.replaceAll(/twitter\.com\/t\.co/g, "t.co"); .replaceAll(/twitter\.com\/t\.co/g, "t.co");
} }
content = content.replace(/`/g, "\u02cb"); content = content.replaceAll("`", "\u02cb").replaceAll("*", "\u2217");
content = htmlToMarkdown(content); content = htmlToMarkdown(content);
content = content.replaceAll("||", "|\u200b|");
if (platformName == "Nitter") { if (platformName == "Nitter") {
content = content.replace("\u2198", Icons.fedimbed.quote).replace("> **\u24d8", "> **\u2139\ufe0f"); content = content.replace("\u2198", Icons.fedimbed.quote).replace("> **\u24d8", "> **\u2139\ufe0f");
@ -1322,7 +1322,7 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote =
let MAX_LENGTH = 3999; let MAX_LENGTH = 3999;
if (cw != "" || sensitive) { if (cw != "" || sensitive) {
const ors = content.split("||"); const ors = content.split("||");
desc += `||${content.replaceAll("||", "|\u200b|")}||`; desc += `||${content}||`;
MAX_LENGTH -= ors.length - 1; MAX_LENGTH -= ors.length - 1;
MAX_LENGTH -= 4; MAX_LENGTH -= 4;
} else { } else {