const fs = require('fs'); const path = require('path'); const dir = path.join(__dirname, 'web'); const files = fs.readdirSync(dir).filter(f => f.endsWith('.html')); for (const file of files) { let p = path.join(dir, file); let c = fs.readFileSync(p, 'utf8'); // Fix missing closing quotes for placeholders c = c.replace(/placeholder="中文名 style/g, 'placeholder="中文名" style'); c = c.replace(/placeholder="英文名 style/g, 'placeholder="英文名" style'); // Fix missing < in closing tags c = c.replace(/中文名\/label>/g, '中文名'); c = c.replace(/英文名\/label>/g, '英文名'); c = c.replace(/特急票价\/label>/g, '特急票价'); c = c.replace(/可换乘到的站点\/label>/g, '可换乘到的站点'); c = c.replace(/可换乘\/span>/g, '可换乘'); c = c.replace(/仪表盘\/div>/g, '仪表盘'); c = c.replace(/今日售票额\/div>/g, '今日售票额'); c = c.replace(/站点数\/div>/g, '站点数'); c = c.replace(/线路与票价\/div>/g, '线路与票价'); c = c.replace(/控制台\/div>/g, '控制台'); c = c.replace(/控制台\/title>/g, '控制台'); c = c.replace(/登录\/title>/g, '登录'); c = c.replace(/登录\/div>/g, '登录'); c = c.replace(/加载中\.\.\.\/div>/g, '加载中...'); c = c.replace(/凭证不存在\/h2>/g, '凭证不存在'); c = c.replace(/凭证码\/th>/g, '凭证码'); c = c.replace(/状态\/th>/g, '状态'); c = c.replace(/文件名\/th>/g, '文件名'); c = c.replace(/文件夹\/th>/g, '文件夹'); // In case it was replaced to this c = c.replace(/生成凭证码\/button>/g, '生成凭证码'); c = c.replace(/复制凭证码\/button>/g, '复制凭证码'); fs.writeFileSync(p, c, 'utf8'); } console.log('Done');