# -*- coding: utf-8 -*- """关联项目页签.bru:响应示例 JSON 整体缩进 +2 空格(对齐 docs 块基准)""" import io, sys from pathlib import Path sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') p = Path(r'D:\code\crm-api-docs\A4 客户管理\客户详情\关联项目\关联项目页签.bru') txt = p.read_text(encoding='utf-8') start = txt.index(' ```json\n') end = txt.index('\n ```', start) body = txt[start + len(' ```json\n'):end] fixed = '\n'.join((' ' + ln if ln.strip() else ln) for ln in body.split('\n')) p.write_text(txt[:start + len(' ```json\n')] + fixed + txt[end:], encoding='utf-8', newline='') print('[OK] JSON 缩进 +2 完成')