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.
This commit is contained in:
2026-03-30 12:43:48 +05:30
parent 2505497846
commit cbe6bfdb10
+4 -3
View File
@@ -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)