fix: subs fixes

This commit is contained in:
fufsob committed 2026-09-10 09:42:25 +00:00
1 parent 2a319d1f88
commit b892384527
6 files changed
+127 -12

No files matched your search

+4 -1
View File
@@ -238,7 +238,10 @@ def decode_subscription(data: bytes) -> list[str]:
def slugify_tag(remark: str) -> str:
slug = re.sub(r"[^a-zA-Z0-9_-]", "-", remark)
# \w is Unicode-aware: non-Latin remarks (e.g. Cyrillic country names) keep
# their letters instead of collapsing to a bare "proxy" tag. Tags only ever
# reach JSON configs and the Clash API, both UTF-8 safe.
slug = re.sub(r"[^\w-]", "-", remark)
slug = re.sub(r"-{2,}", "-", slug).strip("-")
return slug[:60] or "proxy"