finally fixed sorting
This commit is contained in:
parent
a273d1fc02
commit
aee0668223
2 changed files with 4 additions and 4 deletions
|
@ -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":[]}]}]
|
|
@ -104,14 +104,14 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ret += `<a href="/post/${id}">[Open]</a></div>`
|
ret += `<a href="/post/${id}">[Open]</a></div>`
|
||||||
for(const comment of post.comments) {
|
for(let i = 0; i < post.comments.length; i++) {
|
||||||
recurse(comment)
|
recurse(post.comments[i])
|
||||||
}
|
}
|
||||||
ret += '</post>'
|
ret += '</post>'
|
||||||
}
|
}
|
||||||
|
|
||||||
recurse(post)
|
recurse(post)
|
||||||
return
|
return ret
|
||||||
})() %>
|
})() %>
|
||||||
</div>
|
</div>
|
||||||
<body>
|
<body>
|
||||||
|
|
Loading…
Add table
Reference in a new issue