From cbe6bfdb101b636fbc1252f72807b65b07f50610 Mon Sep 17 00:00:00 2001 From: bendtherules Date: Mon, 30 Mar 2026 12:43:48 +0530 Subject: [PATCH] refactor(build_graph): limit emu-clause selection to #spec-container Search for `emu-clause` elements now performed within the `#spec-container` element instead of the entire document, preventing accidental matches outside the spec container. --- setup/build_graph.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/setup/build_graph.ts b/setup/build_graph.ts index 73d6a8c..41d50d2 100644 --- a/setup/build_graph.ts +++ b/setup/build_graph.ts @@ -24,8 +24,8 @@ async function buildGraph() { const fileName = path.basename(file); const content = fs.readFileSync(file, "utf-8"); const $ = cheerio.load(content); - - $("emu-clause").each((_i, elem) => { + const $container = $("#spec-container"); + $container.find("emu-clause").each((_i, elem) => { const id = $(elem).attr("id"); const title = $(elem).find("h1").first().text().trim(); @@ -55,7 +55,8 @@ async function buildGraph() { for (const file of htmlFiles) { const content = fs.readFileSync(file, "utf-8"); const $ = cheerio.load(content); - $("emu-clause").each((_i, elem) => { + const $container = $("#spec-container"); + $container.find("emu-clause").each((_i, elem) => { const sourceId = $(elem).attr("id"); if (sourceId && graph.hasNode(sourceId)) { $(elem)