Skip to content

Commit

Permalink
Merge pull request #715 from XMOJ-Script-dev/zhouyiqing0304-patch-2
Browse files Browse the repository at this point in the history
更改短消息显示
  • Loading branch information
zhouyiqing0304 authored Aug 19, 2024
2 parents 04d6e4d + f3d87e8 commit 246cedf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
11 changes: 11 additions & 0 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -2453,6 +2453,17 @@
}
],
"Notes": "No release notes were provided for this release."
},
"1.2.58": {
"UpdateDate": 1724058379641,
"Prerelease": true,
"UpdateContents": [
{
"PR": 715,
"Description": "更改短消息显示"
}
],
"Notes": "No release notes were provided for this release."
}
}
}
8 changes: 5 additions & 3 deletions XMOJ.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
// @version 1.2.57
// @version 1.2.58
// @description XMOJ增强脚本
// @author @XMOJ-Script-dev, @langningchen and the community
// @namespace https://github/langningchen
Expand Down Expand Up @@ -598,7 +598,9 @@ class NavbarStyler {
}
}
}

function replaceMarkdownImages(text,string) {
return text.replace(/!\[.*?\]\(.*?\)/g,string);
}
async function main() {
try {
if (location.href.startsWith('http://')) {
Expand Down Expand Up @@ -4147,7 +4149,7 @@ int main()
}
let LastsMessageCell = document.createElement("td");
Row.appendChild(LastsMessageCell);
LastsMessageCell.innerText = Data[i].LastsMessage;
LastsMessageCell.innerText = replaceMarkdownImages(Data[i].LastsMessage,'[image]');
let SendTimeCell = document.createElement("td");
Row.appendChild(SendTimeCell);
SendTimeCell.innerHTML = GetRelativeTime(Data[i].SendTime);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xmoj-script",
"version": "1.2.57",
"version": "1.2.58",
"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
"scripts": {
Expand Down

0 comments on commit 246cedf

Please sign in to comment.