mind-map/apps/web/scripts/fix-topology-cjk4.py
oliver 2ecd300ada Initial commit: DSH mind-map canvas monorepo
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-12 08:53:37 +08:00

22 lines
654 B
Python

# -*- coding: utf-8 -*-
from pathlib import Path
p = Path(__file__).resolve().parents[1] / "src" / "TopologyCanvas.tsx"
t = p.read_text(encoding="utf-8")
pairs = [
(
'title="???????????? (N)??? Shift ??????"',
'title="单点拖拽:只移动当前节点 (N);按住 Shift 也可临时单点"',
),
(
'title="?????????????? (B)"',
'title="整枝拖拽:节点与子孙一起移动 (B)"',
),
]
for old, new in pairs:
if old not in t:
raise SystemExit(f"missing: {old}")
t = t.replace(old, new, 1)
print("fixed:", new[:40])
p.write_text(t, encoding="utf-8", newline="\n")
print("done")