mirror of
https://github.com/KOP-XIAO/QuantumultX.git
synced 2026-03-24 16:15:08 +00:00
Update resource-parser.js
This commit is contained in:
@@ -3050,7 +3050,7 @@ function YAMLFix(cnt){
|
||||
cnt = cnt.replace(/\[/g,"yaml@bug1").replace(/\\r/g,"").replace(/\*/g,"yaml@bug2")
|
||||
//2022-08-08 增加 .replace(/\*/g,"🌟@bug2") 以解决名字以 * 开始时引起的部分问题
|
||||
if (cnt.indexOf("{") != -1 && /\{\s*\"*(name|type|server)/.test(cnt)){ // - { } 类型 yaml
|
||||
cnt = cnt.replace(/ +/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")
|
||||
//2022-04-11 remove tls|skip from replace(/, (Host|host|path|mux)/g,", $1")
|
||||
console.log("1st:\n"+cnt)
|
||||
|
||||
Reference in New Issue
Block a user