Merge pull request #273 from izhangxm/master

修复clash规则头部有注释的情况下规则转换功能失败的问题
This commit is contained in:
xream 2024-01-18 17:07:59 +08:00 committed by GitHub
commit 1543e76841
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,7 +8,7 @@ function HTML() {
function ClashProvider() {
const name = 'Clash Provider';
const test = (raw) => raw.indexOf('payload:') === 0;
const test = (raw) => /^payload:/gm.exec(raw).index >= 0;
const parse = (raw) => {
return raw.replace('payload:', '').replace(/^\s*-\s*/gm, '');
};