fixed a linebreak bug

This commit is contained in:
CatAClock 2025-05-22 16:00:22 -07:00
parent 5dbc2a2b44
commit 5eb0527d70
2 changed files with 5 additions and 0 deletions

View file

@ -117,6 +117,9 @@ async function GetPost() {
}
// Text. This will be modified later.
var Text = post.post.record.text;
console.log(Text);
var TestText = Text.replace(/\r?\n|\r/g, "");
console.log(TestText);
// Check for facets. Facets are things that change what the text does or looks like.
if (post.post.record.hasOwnProperty("facets")) {
for (let i of post.post.record.facets) {
@ -132,6 +135,7 @@ async function GetPost() {
}
}
// Place the text.
Text = Text.replace(/\r?\n|\r/g, "<br/>");
document.getElementsByClassName("PostText Regular")[0].innerHTML = Text;
// Show the image if it exists.
if (post.post.record.hasOwnProperty("embed")) {

View file

@ -286,6 +286,7 @@ async function PosterContainerUpdate(Direction) {
}
}
}
TempText = TempText.replace(/\r?\n|\r/g, "<br/>");
i.getElementsByClassName("PostContent")[0].innerHTML += TempText;
break;
case 2: