fedimbed: escape || in sensitive content
This commit is contained in:
parent
6576d7f9bd
commit
9cd4c3a98c
1 changed files with 3 additions and 1 deletions
|
@ -575,7 +575,9 @@ async function processUrl(msg, url, spoiler = false) {
|
||||||
let desc = "";
|
let desc = "";
|
||||||
let MAX_LENGTH = 3999;
|
let MAX_LENGTH = 3999;
|
||||||
if ((cw != "" || sensitive) && images.length == 0 && videos.length == 0 && audios.length == 0) {
|
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;
|
MAX_LENGTH -= 4;
|
||||||
|
|
||||||
if (cw != "") {
|
if (cw != "") {
|
||||||
|
|
Loading…
Reference in a new issue