feat: 第 13-16 章正文(Skill 机制 / HTTP 接口层 / 前端 / 基础设施与部署)

This commit is contained in:
2026-10-20 21:56:23 +08:00
parent c7c3fda5eb
commit 64a60383e0
13 changed files with 1038 additions and 65 deletions

View File

@@ -0,0 +1,17 @@
const fs = require('fs');
const p = '15-frontend.html';
let h = fs.readFileSync(p, 'utf8');
// 1) 全文件:数字实体 -> 命名实体
h = h.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&');
// 2) 代码块内:补齐 & 与 > 的转义(< 已全部处理)
h = h.replace(/<pre([^>]*)>([\s\S]*?)<\/pre>/g, (m, attrs, body) => {
let b = body;
b = b.replace(/&(?!(amp|lt|gt|quot|#\d+);)/g, '&amp;');
b = b.replace(/>/g, '&gt;');
return `<pre${attrs}>${b}</pre>`;
});
fs.writeFileSync(p, h);
console.log('done, bytes', h.length);