surgioproject / surgio

Generating rules for Surge, Clash, Quantumult like a PRO

Home Page:https://surgio.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

template中使用getClashNodeNames时出现缩进错误

xkww3n opened this issue · comments

在template中填写以下内容:

proxy-groups:
- type: select
  name: Proxy
  proxies: 
    - HK
    - TW
    - US
    - JP
    {{ getClashNodeNames(nodeList) | yaml }}

预期生成的内容应当是所有Clash节点条目具有相同的缩进:

proxy-groups:
- type: select
  name: Proxy
  proxies: 
    - HK
    - TW
    - US
    - JP
    - 节点1
    - 节点2
    - 节点3

但实际上只有“节点1”条目会有缩进,剩下的条目将不会缩进:

proxy-groups:
- type: select
  name: Proxy
  proxies: 
    - HK
    - TW
    - US
    - JP
    - 节点1
- 节点2
- 节点3

这样的配置文件将不会被代理软件所接受。

getClashNodeNames 支持在前端增加额外的名称,例如 getClashNodeNames(nodeList, undefined, ['HK', 'TW])

文档:https://surgio.js.org/guide/custom-template.html#getclashnodenames