Fix needs-info log section parsing

This commit is contained in:
tapframe 2026-06-14 19:50:53 +05:30
parent 1a2eca2341
commit 09afea7c35

View file

@ -32,8 +32,12 @@ jobs:
return labels.includes(name.toLowerCase());
}
function escapeRegExp(value) {
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function extractSection(title) {
const re = new RegExp(`^###\\s+${title.replace(/[.*+?^${}()|[\\]\\\\]/g, "\\\\$&")}\\s*$`, "m");
const re = new RegExp(`^###\\s+${escapeRegExp(title)}\\s*$`, "m");
const match = body.match(re);
if (!match) return "";
const start = match.index + match[0].length;