diff --git a/Update.json b/Update.json index 4525eb61..f01e7aed 100644 --- a/Update.json +++ b/Update.json @@ -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." } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 3b3d4ddc..667a0e14 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -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 @@ -598,7 +598,9 @@ class NavbarStyler { } } } - +function replaceMarkdownImages(text,string) { + return text.replace(/!\[.*?\]\(.*?\)/g,string); +} async function main() { try { if (location.href.startsWith('http://')) { @@ -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); diff --git a/package.json b/package.json index 46d473a4..8db9e4c6 100644 --- a/package.json +++ b/package.json @@ -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": {