finally fixed sorting

This commit is contained in:
Daniella / Tove 2022-01-17 09:31:53 +01:00
parent a273d1fc02
commit aee0668223
2 changed files with 4 additions and 4 deletions

View file

@ -1 +1 @@
[{"title":"Default post","content":"This is the first post, it was here since the beginning.\n(Remove the space after the '[' and before the ']')\n [ * [* text *] * ] [ ** [** text **] ** ] [ *** [*** text ***] *** ] [ _ [_ text _] _ ] [ *_ [*_ text _*] _* ] [ **_ [**_ text _**] _** ] [ ***_ [***_ text _***] _*** [ **_ [**_ text _**] _** ] [ ***_ [***_ text _***] _*** ] [ \" [\" text \"] \" ]","author":"root","comments":[{"title":"The first comment","content":"This is the first comment, it was here since the beginning.","author":"Anonymous","comments":[]}]}]
[{"author":"Anonymous","title":"asd","content":"asd","comments":[]},{"title":"Default post","content":"This is the first post, it was here since the beginning.\n(Remove the space after the '[' and before the ']')\n [ * [* text *] * ] [ ** [** text **] ** ] [ *** [*** text ***] *** ] [ _ [_ text _] _ ] [ *_ [*_ text _*] _* ] [ **_ [**_ text _**] _** ] [ ***_ [***_ text _***] _*** [ **_ [**_ text _**] _** ] [ ***_ [***_ text _***] _*** ] [ \" [\" text \"] \" ]","author":"root","comments":[{"author":"Anonymous","title":"wef","content":"tegw","comments":[{"author":"Anonymous","title":"asd","content":"asd","comments":[]},{"author":"Anonymous","title":"wef","content":"wef","comments":[]}]},{"title":"The first comment","content":"This is the first comment, it was here since the beginning.","author":"Anonymous","comments":[]}]}]

View file

@ -104,14 +104,14 @@
}
else
ret += `<a href="/post/${id}">[Open]</a></div>`
for(const comment of post.comments) {
recurse(comment)
for(let i = 0; i < post.comments.length; i++) {
recurse(post.comments[i])
}
ret += '</post>'
}
recurse(post)
return
return ret
})() %>
</div>
<body>