Files
ALL-teach_sys/frontend_食品/fix_resume_bold.py

32 lines
884 B
Python
Raw Normal View History

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
修复resumeInterviewMock.js中modified字段的加粗符号
"""
import re
import json
file_path = "/Users/apple/Documents/cursor/教务系统/frontend_食品/src/mocks/resumeInterviewMock.js"
# 读取文件
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()
# 统计修改前的加粗符号数量
original_count = content.count('**')
print(f"文件中原有 ** 符号数量: {original_count}")
# 移除所有的 ** 符号
content_fixed = content.replace('**', '')
# 统计修改后的加粗符号数量
fixed_count = content_fixed.count('**')
print(f"修复后 ** 符号数量: {fixed_count}")
# 写回文件
with open(file_path, 'w', encoding='utf-8') as f:
f.write(content_fixed)
print(f"✓ 已删除 {(original_count - fixed_count) // 2} 处加粗文本")
print(f"文件已更新: {file_path}")