From e2e31c8e01696b272ff891a0fd45de46af44bc79 Mon Sep 17 00:00:00 2001 From: boomzero Date: Thu, 8 Aug 2024 14:12:33 +0800 Subject: [PATCH 1/3] fix reply infinite looping --- XMOJ.user.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 63ea0acb..50ae05a9 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -4756,11 +4756,9 @@ int main() ReplyButton.innerText = "回复"; ReplyButton.addEventListener("click", () => { let Content = Replies[i].Content; - while (Content.startsWith(">")) { - Content = Content.substring(Content.indexOf("\n") + 1); - } - Content = Content.trim(); Content = Content.split("\n").map((Line) => { + return Line.startsWith(">") ? Line.substring(1).trim() : Line.trim(); + }).join("\n").split("\n").map((Line) => { return "> " + Line; }).join("\n"); ContentElement.value += Content + `\n\n@${Replies[i].UserID} `; From 3a7ecfe76dfa90c6c19826b95e5dd108ebe69cf3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 8 Aug 2024 06:13:29 +0000 Subject: [PATCH 2/3] 1.2.43 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aa3ad910..cb485ddf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "1.2.42", + "version": "1.2.43", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": { From d42647b641309862eac80a252a8daa332b744fca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 8 Aug 2024 06:13:30 +0000 Subject: [PATCH 3/3] Update version info to 1.2.43 --- Update.json | 11 +++++++++++ XMOJ.user.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 3f3e9653..d633e4a6 100644 --- a/Update.json +++ b/Update.json @@ -2252,6 +2252,17 @@ } ], "Notes": "No release notes were provided for this release." + }, + "1.2.43": { + "UpdateDate": 1723097609941, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 664, + "Description": "fix reply infinite looping" + } + ], + "Notes": "No release notes were provided for this release." } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 50ae05a9..2c210d90 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 1.2.42 +// @version 1.2.43 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen