mirror of
https://github.com/KOP-XIAO/QuantumultX.git
synced 2026-01-25 17:15:09 +00:00
yaml fix
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2023-03-15 13:00⟧
|
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2023-03-23 12:00⟧
|
||||||
----------------------------------------------------------
|
----------------------------------------------------------
|
||||||
🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/Shawn_Parser_Bot
|
🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/Shawn_Parser_Bot
|
||||||
⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API
|
⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API
|
||||||
@@ -2759,8 +2759,13 @@ function YAMLFix(cnt){
|
|||||||
cnt = cnt.replace(/{\s*name: /g,"{name: \"").replace(/, server:/g,"\", server:")
|
cnt = cnt.replace(/{\s*name: /g,"{name: \"").replace(/, server:/g,"\", server:")
|
||||||
cnt = cnt.replace(/{|}/g,"").replace(/,/g,"\n ")
|
cnt = cnt.replace(/{|}/g,"").replace(/,/g,"\n ")
|
||||||
}
|
}
|
||||||
cnt = cnt.replace(/ -\s*\n.*name/g," - name").replace(/\$|\`/g,"").split("proxy-providers:")[0].split("proxy-groups:")[0].replace(/\"(name|type|server|port|cipher|password|)(\"*)/g,"$1")
|
cnt = cnt.replace(/\n\s*\-\s*\n.*name/g,"\n - name").replace(/\$|\`/g,"").split("proxy-providers:")[0].split("proxy-groups:")[0].replace(/\"(name|type|server|port|cipher|password)(\"*)/g,"$1")
|
||||||
// console.log("part-fix:\n"+cnt.split("proxies:")[1])
|
if(Pdbg == 1) {
|
||||||
|
$notify("part-fix0:","","part-fix0:\nproxies:\n"+cnt.split("proxies:")[1])}
|
||||||
|
// 2023-03-23 👇修正部分类型
|
||||||
|
cnt = cnt.replace(/\n\s{2}([a-zA-Z]+.*\:)/g,"\n $1")
|
||||||
|
if(Pdbg == 1) {
|
||||||
|
$notify("part-fix1:","","part-fix1:\nproxies:\n"+cnt.split("proxies:")[1])}
|
||||||
// cnt = cnt.indexOf("proxies:") == -1? "proxies:\n" + cnt :"proxies:"+cnt.split("proxies:")[1]
|
// cnt = cnt.indexOf("proxies:") == -1? "proxies:\n" + cnt :"proxies:"+cnt.split("proxies:")[1]
|
||||||
cnt = cnt.replace(/name\:(.*?)\:(.*?)\n/gmi,"name:$1冒号$2\n").replace(/\s{6}Host\:/g," Host:")//.replace(/\{\s*(Host\:.*)\}/gmi,"$1") //罕见bug情况 修复
|
cnt = cnt.replace(/name\:(.*?)\:(.*?)\n/gmi,"name:$1冒号$2\n").replace(/\s{6}Host\:/g," Host:")//.replace(/\{\s*(Host\:.*)\}/gmi,"$1") //罕见bug情况 修复
|
||||||
items=cnt.split("\n").map(yamlcheck)
|
items=cnt.split("\n").map(yamlcheck)
|
||||||
@@ -2776,6 +2781,8 @@ function YAMLFix(cnt){
|
|||||||
//console.log("part-fix:\n"+cnt.split("proxies:")[1])
|
//console.log("part-fix:\n"+cnt.split("proxies:")[1])
|
||||||
cnt = cnt.indexOf("proxies:") == -1? "proxies:\n" + cnt :"proxies:"+cnt.split("proxies:")[1]
|
cnt = cnt.indexOf("proxies:") == -1? "proxies:\n" + cnt :"proxies:"+cnt.split("proxies:")[1]
|
||||||
console.log("after-fix\n"+cnt)
|
console.log("after-fix\n"+cnt)
|
||||||
|
if(Pdbg == 1) {
|
||||||
|
$notify("After-Fix","this is", "After-fix:\n"+cnt)}
|
||||||
//$notify("After-Fix","this is", cnt)
|
//$notify("After-Fix","this is", cnt)
|
||||||
|
|
||||||
return cnt
|
return cnt
|
||||||
|
|||||||
Reference in New Issue
Block a user