// 提取 a3-1-1-2-4 添加关联客户弹窗批注正文(内容单元格 u428/u431/u439/u447/u455/u463) import fs from 'node:fs'; const html = fs.readFileSync('e:/code/crm-backend-matt/.scratch/lanhu-latest/v29-customer-pages/a3-1-1-2-4_raw.html', 'utf8'); const decode = (s) => s .replace(/([0-9A-Fa-f]+);/g, (_, h) => String.fromCodePoint(parseInt(h, 16))) .replace(/(\d+);/g, (_, d) => String.fromCodePoint(parseInt(d, 10))) .replace(/ /g, ' '); for (const id of ['u428', 'u431', 'u439', 'u447', 'u455', 'u463']) { const m = html.match(new RegExp(`
]*>[\s\S]*?<\/span><\/p>/g) || []) .map(p => decode(p.replace(/<\/?p>/g, '').replace(/<\/?span[^>]*>/g, '')).trim()) .filter(p => p && p !== ' '); console.log(`\n===== ${id} =====\n${paras.join('\n')}`); }