Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #586 from langningchen:langningchen/fix-at
Browse files Browse the repository at this point in the history
修复因为严格导致的 @ 不显示
  • Loading branch information
Chen LangNing authored Oct 2, 2023
2 parents d0aebcf + 8adfded commit bbc08b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,16 @@
"Description": "自制图床,讨论区 Ctrl+V 上传图片"
}
]
},
"0.3.193": {
"UpdateDate": 1696227624991,
"Prerelease": true,
"UpdateContents": [
{
"PR": 586,
"Description": "修复因为严格导致的 @ 不显示"
}
]
}
}
}
4 changes: 2 additions & 2 deletions XMOJ.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
// @version 0.3.192
// @version 0.3.193
// @description XMOJ增强脚本
// @author @langningchen
// @namespace https://github/langningchen
Expand Down Expand Up @@ -4077,7 +4077,7 @@ int main()
let CardBodyHRElement = document.createElement("hr"); CardBodyElement.appendChild(CardBodyHRElement);

let ReplyContentElement = document.createElement("div"); CardBodyElement.appendChild(ReplyContentElement);
ReplyContentElement.innerHTML = PurifyHTML(marked.parse(Replies[i].Content.replaceAll(/@([a-zA-Z0-9]+)/g, `<b>@</b><span class="ms-1 Usernames">$1</span>`)));
ReplyContentElement.innerHTML = PurifyHTML(marked.parse(Replies[i].Content)).replaceAll(/@([a-zA-Z0-9]+)/g, `<b>@</b><span class="ms-1 Usernames">$1</span>`);
if (Replies[i].EditTime != null) {
if (Replies[i].EditPerson !== CurrentUsername) {
ReplyContentElement.innerHTML += `<span class="text-muted" style="font-size: 12px">最后编辑于${GetRelativeTime(Replies[i].EditTime)}</span>`;
Expand Down

0 comments on commit bbc08b5

Please sign in to comment.