mirror of
https://github.com/hansjone/mind-map.git
synced 2026-10-09 05:53:19 +08:00
Initial commit: DSH mind-map canvas monorepo
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
2ecd300ada
92 changed files with 20486 additions and 0 deletions
15
apps/web/scripts/_fix_leftover.py
Normal file
15
apps/web/scripts/_fix_leftover.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from pathlib import Path
|
||||
import re
|
||||
|
||||
p = Path(r"d:\project\chatgpt\mind-map\apps\web\src\TopologyCanvas.tsx")
|
||||
t = p.read_text(encoding="utf-8")
|
||||
for m in re.finditer(r'.{0,60}"\?{2,}".{0,40}', t):
|
||||
print(repr(m.group(0)))
|
||||
# fix leftover ??? for create_node
|
||||
if ': { type: "create_node", text: "???" }' in t:
|
||||
t = t.replace(': { type: "create_node", text: "???" }', ': { type: "create_node", text: "新节点" }')
|
||||
p.write_text(t, encoding="utf-8", newline="\n")
|
||||
print("fixed leftover")
|
||||
print("quoted left", re.findall(r'"\?{2,}"', t))
|
||||
print("cjk count", len(re.findall(r"[\u4e00-\u9fff]+", t)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue