From e707ae421bc53783d9f591146d65df30b4597419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=A9=BA=E3=82=B9=E3=83=90=E3=83=AB=E5=A4=A7?= =?UTF-8?q?=E5=A5=BD=E3=81=8D?= <111629702+BlueBoy247@users.noreply.github.com> Date: Fri, 30 Aug 2024 02:10:52 +0800 Subject: [PATCH] Update posting.js --- scripts/posting.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/posting.js b/scripts/posting.js index 44c2bda..b3267ce 100644 --- a/scripts/posting.js +++ b/scripts/posting.js @@ -5,7 +5,7 @@ function listPostsPage(now){ url: '/blog/postlist.txt', async: false, success: function(data){ - page = Math.ceil((data.split('\n').length) / postNum); + page = Math.ceil((data.split('\n').filter(line => line.trim() !== '').length) / postNum); } }); if(now==undefined){ @@ -43,7 +43,7 @@ function listPostsBlock(startNum,endNum){ url: '/blog/postlist.txt', async: false, success: function(data){ - fileList = data.split('\n'); + fileList = data.split('\n').filter(line => line.trim() !== ''); } }); if (fileList==[] || fileList==""){ @@ -59,8 +59,7 @@ function listPostsBlock(startNum,endNum){ $(`#postblock`).css("display","table"); fileList.reverse(); for (let i=startNum; i