fix escaping
This commit is contained in:
@@ -564,7 +564,10 @@ class YouProvider {
|
|||||||
if (this.isRotationEnabled) {
|
if (this.isRotationEnabled) {
|
||||||
this.checkAndSwitchMode();
|
this.checkAndSwitchMode();
|
||||||
if (!Object.values(this.modeStatus).some(status => status)) {
|
if (!Object.values(this.modeStatus).some(status => status)) {
|
||||||
return;
|
this.modeStatus.default = true;
|
||||||
|
this.modeStatus.custom = true;
|
||||||
|
this.currentMode = "default";
|
||||||
|
console.log("两种模式都达到请求上限,重置记录状态。");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 处理模式轮换逻辑
|
// 处理模式轮换逻辑
|
||||||
@@ -1100,17 +1103,20 @@ class YouProvider {
|
|||||||
export default YouProvider;
|
export default YouProvider;
|
||||||
|
|
||||||
function unescapeContent(content) {
|
function unescapeContent(content) {
|
||||||
// 将 \" 替换为 "
|
try {
|
||||||
content = content.replace(/\\"/g, '"');
|
return JSON.parse(`"${content.replace(/"/g, '\\"')}"`);
|
||||||
|
} catch (e) {
|
||||||
|
// 将 \" 替换为 "
|
||||||
|
content = content.replace(/\\"/g, '"');
|
||||||
|
|
||||||
|
content = content.replace(/\\n/g, '');
|
||||||
|
|
||||||
// 将 \n 替换为 实际的换行
|
// 将 \r 替换为空字符
|
||||||
content = content.replace(/\\n/g, '\n');
|
content = content.replace(/\\r/g, '');
|
||||||
|
|
||||||
// 将 \r 替换为 空字符串
|
// 将 「 和 」 替换为 "
|
||||||
content = content.replace(/\\r/g, '');
|
content = content.replace(/[「」]/g, '"');
|
||||||
|
|
||||||
// 将 「 和 」 替换为 "
|
return content;
|
||||||
content = content.replace(/[「」]/g, '"');
|
}
|
||||||
|
|
||||||
return content;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user