mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🐞 fix: 仅对 windows 进行转义
This commit is contained in:
parent
f8aec9a2ab
commit
f3b3f83da3
@ -1433,7 +1433,7 @@ export class tools extends plugin {
|
|||||||
const urlRex = /(?:https?:\/\/)?(www\.|music\.)?youtube\.com\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
const urlRex = /(?:https?:\/\/)?(www\.|music\.)?youtube\.com\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
||||||
const url2Rex = /(?:https?:\/\/)?youtu\.be\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
const url2Rex = /(?:https?:\/\/)?youtu\.be\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
||||||
// 检测操作系统平台
|
// 检测操作系统平台
|
||||||
const isWindows = process.platform === 'win32';
|
const isWindows = process.platform === 'win32';
|
||||||
|
|
||||||
// 匹配并转义 URL 中的 & 符号(仅对 Windows 进行转义)
|
// 匹配并转义 URL 中的 & 符号(仅对 Windows 进行转义)
|
||||||
let url = urlRex.exec(e.msg)?.[0]?.replace(/&/g, isWindows ? '^&' : '&') ||
|
let url = urlRex.exec(e.msg)?.[0]?.replace(/&/g, isWindows ? '^&' : '&') ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user