Compare commits

...

2 Commits

Author SHA1 Message Date
xream
fe804fcf2c release: bump version 2025-08-08 12:43:53 +08:00
xream
c7c9b21f79 feat: 本地订阅支持混写单行 YAML
Some checks failed
build / build (push) Has been cancelled
2025-08-04 10:48:52 +08:00
2 changed files with 12 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "sub-store", "name": "sub-store",
"version": "2.20.0", "version": "2.20.2",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js", "main": "src/main.js",
"scripts": { "scripts": {

View File

@@ -13,6 +13,7 @@ import getQXParser from './peggy/qx';
import getTrojanURIParser from './peggy/trojan-uri'; import getTrojanURIParser from './peggy/trojan-uri';
import $ from '@/core/app'; import $ from '@/core/app';
import JSON5 from 'json5'; import JSON5 from 'json5';
import YAML from '@/utils/yaml';
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
@@ -1130,15 +1131,21 @@ function URI_Trojan() {
function Clash_All() { function Clash_All() {
const name = 'Clash Parser'; const name = 'Clash Parser';
const test = (line) => { const test = (line) => {
let proxy;
try { try {
JSON5.parse(line); proxy = JSON5.parse(line);
} catch (e) { } catch (e) {
return false; proxy = YAML.parse(line);
} }
return true; return !!proxy?.type;
}; };
const parse = (line) => { const parse = (line) => {
const proxy = JSON5.parse(line); let proxy;
try {
proxy = JSON5.parse(line);
} catch (e) {
proxy = YAML.parse(line);
}
if ( if (
![ ![
'anytls', 'anytls',