mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 13:21:55 +00:00
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:
@@ -24,8 +24,8 @@ async function buildGraph() {
|
|||||||
const fileName = path.basename(file);
|
const fileName = path.basename(file);
|
||||||
const content = fs.readFileSync(file, "utf-8");
|
const content = fs.readFileSync(file, "utf-8");
|
||||||
const $ = cheerio.load(content);
|
const $ = cheerio.load(content);
|
||||||
|
const $container = $("#spec-container");
|
||||||
$("emu-clause").each((_i, elem) => {
|
$container.find("emu-clause").each((_i, elem) => {
|
||||||
const id = $(elem).attr("id");
|
const id = $(elem).attr("id");
|
||||||
const title = $(elem).find("h1").first().text().trim();
|
const title = $(elem).find("h1").first().text().trim();
|
||||||
|
|
||||||
@@ -55,7 +55,8 @@ async function buildGraph() {
|
|||||||
for (const file of htmlFiles) {
|
for (const file of htmlFiles) {
|
||||||
const content = fs.readFileSync(file, "utf-8");
|
const content = fs.readFileSync(file, "utf-8");
|
||||||
const $ = cheerio.load(content);
|
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");
|
const sourceId = $(elem).attr("id");
|
||||||
if (sourceId && graph.hasNode(sourceId)) {
|
if (sourceId && graph.hasNode(sourceId)) {
|
||||||
$(elem)
|
$(elem)
|
||||||
|
|||||||
Reference in New Issue
Block a user