From 5c02cdcf5d49b5d5f9cf7d6b3c78b6296b83d6e8 Mon Sep 17 00:00:00 2001 From: CatAClock <CatAClock@proton.me> Date: Thu, 22 May 2025 17:12:48 -0700 Subject: [PATCH] bug fix. parent and grandparent didn't have formatting work :( --- JS/expanded.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/JS/expanded.js b/JS/expanded.js index b3cae1d..3423ec1 100644 --- a/JS/expanded.js +++ b/JS/expanded.js @@ -155,7 +155,9 @@ async function GetPost() { var AnotherPost = await BlueskyAPI.GetRecord(post.reply.parent.uri.split("/")[2], post.reply.parent.uri.split("/")[3], post.reply.parent.uri.split("/")[4]); document.getElementsByClassName("Origin Parent")[0].innerHTML = website; document.getElementsByClassName("Handle Parent")[0].innerHTML = post.reply.parent.author.handle; - document.getElementsByClassName("PostText Parent")[0].innerHTML = AnotherPost.value.text; + Text = AnotherPost.value.text; + Text = Text.replace(/\r?\n|\r/g, "<br/>"); + document.getElementsByClassName("PostText Parent")[0].innerHTML = Text; if (AnotherPost.value.hasOwnProperty("embed")) { await CreateMedia(AnotherPost.value, document.getElementsByClassName("Images Parent")[0], post.reply.parent.author.did); } @@ -165,7 +167,9 @@ async function GetPost() { var AnotherAnotherPost = await BlueskyAPI.GetRecord(AnotherPost.value.reply.parent.uri.split("/")[2], AnotherPost.value.reply.parent.uri.split("/")[3], AnotherPost.value.reply.parent.uri.split("/")[4]); document.getElementsByClassName("Origin GrandParent")[0].innerHTML = website; document.getElementsByClassName("Handle GrandParent")[0].innerHTML = post.reply.grandparentAuthor.handle; - document.getElementsByClassName("PostText GrandParent")[0].innerHTML = AnotherAnotherPost.value.text; + Text = AnotherAnotherPost.value.text; + Text = Text.replace(/\r?\n|\r/g, "<br/>"); + document.getElementsByClassName("PostText GrandParent")[0].innerHTML = Text; if (AnotherAnotherPost.value.hasOwnProperty("embed")) { await CreateMedia(AnotherAnotherPost.value, document.getElementsByClassName("Images GrandParent")[0], post.reply.grandparentAuthor.did); }