(str)
| 4 | let [template, ...chapters] = process.argv.slice(2) |
| 5 | |
| 6 | function esc(str) { |
| 7 | return str.replace(/[<>&"]/g, ch => ch == "<" ? "<" : ch == ">" ? ">" : ch == "&" ? "&" : """) |
| 8 | } |
| 9 | |
| 10 | let toc = "" |
| 11 | const section = /<h2\b[^>]*><a [^>]*?id="(h_.*?)".*?><\/a>(.*?)<\/h2>/g |