From 0654c054d2e1268ef3d59f87dc624cd36145a0e6 Mon Sep 17 00:00:00 2001 From: Yousef Sedik <86931453+YousefSedik@users.noreply.github.com> Date: Tue, 3 Feb 2026 18:36:00 +0200 Subject: [PATCH 1/2] fix: line number is submitted as part of the solution code/sql --- content-script.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/content-script.js b/content-script.js index da47118..09c972b 100644 --- a/content-script.js +++ b/content-script.js @@ -301,7 +301,17 @@ if (!solution) { const codeElement = document.querySelector(SELECTORS.codeBlock) - solution = codeElement?.textContent || "" + lines = codeElement?.children + const code = Array.from(lines).map(line => { + // 2. Get all child nodes of the line, but skip the first one (the line number) + // convert children to an array and slice from index 1 to the end + const codeParts = Array.from(line.childNodes).slice(1); + + // 3. Join the remaining parts back together + return codeParts.map(part => part.textContent).join(''); + }).join('').replace(/\u00A0/g, ' '); + + solution = code || "" } else { solution = solution.replace(/\\n/g, "\n").replace(/ {2}/g, " ").replace(/"/g, "") } From 0deb8a436b94672a7a8cbabe0c5d57b448fd3052 Mon Sep 17 00:00:00 2001 From: Yousef Sedik <86931453+YousefSedik@users.noreply.github.com> Date: Sun, 8 Mar 2026 04:43:25 +0200 Subject: [PATCH 2/2] Improve comments in content-script.js Updated comments for clarity in content-script.js. --- content-script.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content-script.js b/content-script.js index 09c972b..e2dbc85 100644 --- a/content-script.js +++ b/content-script.js @@ -303,11 +303,11 @@ const codeElement = document.querySelector(SELECTORS.codeBlock) lines = codeElement?.children const code = Array.from(lines).map(line => { - // 2. Get all child nodes of the line, but skip the first one (the line number) + // Get all child nodes of the line, but skip the first one (the line number) // convert children to an array and slice from index 1 to the end const codeParts = Array.from(line.childNodes).slice(1); - - // 3. Join the remaining parts back together + + // Join the remaining parts back together return codeParts.map(part => part.textContent).join(''); }).join('').replace(/\u00A0/g, ' ');