fedimbed: escape || in sensitive content

This commit is contained in:
Cynthia Foxwell 2024-08-24 09:51:28 -06:00
parent 6576d7f9bd
commit 9cd4c3a98c

View file

@ -575,7 +575,9 @@ async function processUrl(msg, url, spoiler = false) {
let desc = "";
let MAX_LENGTH = 3999;
if ((cw != "" || sensitive) && images.length == 0 && videos.length == 0 && audios.length == 0) {
desc += "||" + content + "||";
const ors = content.split("||");
desc += `||${content.replaceAll("||", "|\u200b|")}||`;
MAX_LENGTH -= ors.length - 1;
MAX_LENGTH -= 4;
if (cw != "") {