xmoj-script 1.2.44 → 1.2.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AddonScript.js +1 -0
- package/Update.json +11 -0
- package/XMOJ.user.js +15 -5
- package/package.json +1 -1
package/AddonScript.js
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
console.log("AddonScript.js has loaded.");
|
package/Update.json
CHANGED
@@ -2274,6 +2274,17 @@
|
|
2274
2274
|
}
|
2275
2275
|
],
|
2276
2276
|
"Notes": "No release notes were provided for this release."
|
2277
|
+
},
|
2278
|
+
"1.2.45": {
|
2279
|
+
"UpdateDate": 1723180072602,
|
2280
|
+
"Prerelease": true,
|
2281
|
+
"UpdateContents": [
|
2282
|
+
{
|
2283
|
+
"PR": 667,
|
2284
|
+
"Description": "fix replying(again)"
|
2285
|
+
}
|
2286
|
+
],
|
2287
|
+
"Notes": "No release notes were provided for this release."
|
2277
2288
|
}
|
2278
2289
|
}
|
2279
2290
|
}
|
package/XMOJ.user.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
// ==UserScript==
|
2
2
|
// @name XMOJ
|
3
|
-
// @version 1.2.
|
3
|
+
// @version 1.2.45
|
4
4
|
// @description XMOJ增强脚本
|
5
5
|
// @author @XMOJ-Script-dev, @langningchen and the community
|
6
6
|
// @namespace https://github/langningchen
|
@@ -4757,10 +4757,20 @@ int main()
|
|
4757
4757
|
ReplyButton.addEventListener("click", () => {
|
4758
4758
|
let Content = Replies[i].Content;
|
4759
4759
|
Content = Content.split("\n").map((Line) => {
|
4760
|
-
|
4761
|
-
|
4762
|
-
|
4763
|
-
|
4760
|
+
// Count the number of '>' characters at the beginning of the line
|
4761
|
+
let nestingLevel = 0;
|
4762
|
+
while (Line.startsWith(">")) {
|
4763
|
+
nestingLevel++;
|
4764
|
+
Line = Line.substring(1).trim();
|
4765
|
+
}
|
4766
|
+
// If the line is nested more than 2 levels deep, skip it
|
4767
|
+
if (nestingLevel > 2) {
|
4768
|
+
return null;
|
4769
|
+
}
|
4770
|
+
// Reconstruct the line with the appropriate number of '>' characters
|
4771
|
+
return "> ".repeat(nestingLevel + 1) + Line;
|
4772
|
+
}).filter(Line => Line !== null) // Remove null entries
|
4773
|
+
.join("\n");
|
4764
4774
|
ContentElement.value += Content + `\n\n@${Replies[i].UserID} `;
|
4765
4775
|
ContentElement.focus();
|
4766
4776
|
});
|