Compare commits

..

2 Commits

Author SHA1 Message Date
Shawn Wen
53a7e425b8 Update resource-parser.js 2026-02-06 15:38:33 +08:00
Shawn Wen
dc56bc8440 Update resource-parser.js 2026-02-06 15:37:05 +08:00

View File

@@ -1,5 +1,5 @@
/** /**
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2026-02-06 10:57⟧ ☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2026-02-06 15:37⟧
---------------------------------------------------------- ----------------------------------------------------------
🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/ShawnKOP_Parser_Bot 🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/ShawnKOP_Parser_Bot
⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API ⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API
@@ -3050,7 +3050,7 @@ function YAMLFix(cnt){
cnt = cnt.replace(/\[/g,"yaml@bug1").replace(/\\r/g,"").replace(/\*/g,"yaml@bug2") cnt = cnt.replace(/\[/g,"yaml@bug1").replace(/\\r/g,"").replace(/\*/g,"yaml@bug2")
//2022-08-08 增加 .replace(/\*/g,"🌟@bug2") 以解决名字以 * 开始时引起的部分问题 //2022-08-08 增加 .replace(/\*/g,"🌟@bug2") 以解决名字以 * 开始时引起的部分问题
if (cnt.indexOf("{") != -1 && /\{\s*\"*(name|type|server)/.test(cnt)){ // - { } 类型 yaml if (cnt.indexOf("{") != -1 && /\{\s*\"*(name|type|server)/.test(cnt)){ // - { } 类型 yaml
cnt = cnt.replace(/\s+/g," ").replace(/\s\-\s\{/g," - {") // 2026-02-06 部分空格解析错误 cnt = cnt.replace(/ +/g," ").replace(/ \- \{/g," - {") // 2026-02-06 部分空格解析错误
cnt = cnt.replace(/(^|\n)- /g, "$1 - ").replace(/ - /g," - ").replace(/:(?!\s)/g,": ").replace(/\,\"/g,", \"").replace(/: {\s{0,1}/g, ": {, ").replace(/, (Host|host|path|mux)/g,", $1") cnt = cnt.replace(/(^|\n)- /g, "$1 - ").replace(/ - /g," - ").replace(/:(?!\s)/g,": ").replace(/\,\"/g,", \"").replace(/: {\s{0,1}/g, ": {, ").replace(/, (Host|host|path|mux)/g,", $1")
//2022-04-11 remove tls|skip from replace(/, (Host|host|path|mux)/g,", $1") //2022-04-11 remove tls|skip from replace(/, (Host|host|path|mux)/g,", $1")
console.log("1st:\n"+cnt) console.log("1st:\n"+cnt)