Skip to content

Commit 28d9035

Browse files
committed
fixed
1 parent 7f76db5 commit 28d9035

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

dist/extension.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297439,14 +297439,14 @@ async function fetchTestCasesWithRetry(page, url) {
297439297439
if (testCases.length === 0) {
297440297440
try {
297441297441
console.log("Trying to extract test cases using .example-block structure...");
297442-
await page.waitForSelector(".example-block", { timeout: 5e3 });
297443-
testCases = await page.$$eval(".example-block", (blocks) => {
297442+
await page.waitForSelector("div.example-block", { timeout: 5e3 });
297443+
testCases = await page.$$eval("div.example-block", (blocks) => {
297444297444
return blocks.map((block) => {
297445-
const inputElement = block.querySelector('strong:contains("Input:") + span.example-io');
297446-
const outputElement = block.querySelector('strong:contains("Output:") + span.example-io');
297445+
const inputElement = Array.from(block.querySelectorAll("strong")).find((el) => el.textContent?.includes("Input:"));
297446+
const outputElement = Array.from(block.querySelectorAll("strong")).find((el) => el.textContent?.includes("Output:"));
297447297447
return {
297448-
input: inputElement ? inputElement.innerText.trim() : null,
297449-
output: outputElement ? outputElement.innerText.trim() : null
297448+
input: inputElement ? inputElement.nextElementSibling.innerText.trim() : null,
297449+
output: outputElement ? outputElement.nextElementSibling.innerText.trim() : null
297450297450
};
297451297451
});
297452297452
});

0 commit comments

Comments
 (0)