From 6aefbd0762a851de5d04b2116b487e15d63e0cd6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Mar 2026 01:37:52 +0000 Subject: [PATCH 1/4] Initial plan From 19ba07a54807955bdd45cd4e753a3d1da584989a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Mar 2026 01:40:39 +0000 Subject: [PATCH 2/4] Fix routes/db/tossup and bonus to replace include virtual directives Co-authored-by: geoffrey-wu <42471355+geoffrey-wu@users.noreply.github.com> Agent-Logs-Url: https://github.com/qbreader/website/sessions/3ddf3e89-4d77-4d7c-8f36-96ab45ed374c --- routes/db/bonus.js | 7 ++++++- routes/db/tossup.js | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/routes/db/bonus.js b/routes/db/bonus.js index 6060cd1ab..046b72bee 100644 --- a/routes/db/bonus.js +++ b/routes/db/bonus.js @@ -7,6 +7,12 @@ import fs from 'fs'; import { ObjectId } from 'mongodb'; const router = Router(); +const head = fs.readFileSync('./client/head.html', 'utf8'); +const nav = fs.readFileSync('./client/nav/index.html', 'utf8'); +const file = fs.readFileSync('./client/db/bonus/index.html', { encoding: 'utf8' }) + .replace('', head) + .replace('', nav); + function removeParentheses (answer) { return answer.replace(/[([].*/g, ''); } @@ -21,7 +27,6 @@ router.get('/', async (req, res) => { if (!bonus) { return res.sendStatus(404); } const description = `Bonus: ${bonus.answers_sanitized.map(a => escapeHTML(removeParentheses(a))).join(' / ')} [${bonus.set.name}]`; - const file = fs.readFileSync('./client/db/bonus/index.html', { encoding: 'utf8' }); res.send(file.replace('', ``)); }); diff --git a/routes/db/tossup.js b/routes/db/tossup.js index 5b00a6657..e81cdb282 100644 --- a/routes/db/tossup.js +++ b/routes/db/tossup.js @@ -7,6 +7,12 @@ import fs from 'fs'; import { ObjectId } from 'mongodb'; const router = Router(); +const head = fs.readFileSync('./client/head.html', 'utf8'); +const nav = fs.readFileSync('./client/nav/index.html', 'utf8'); +const file = fs.readFileSync('./client/db/tossup/index.html', { encoding: 'utf8' }) + .replace('', head) + .replace('', nav); + function removeParentheses (answer) { return answer.replace(/[([].*/g, ''); } @@ -21,7 +27,6 @@ router.get('/', async (req, res) => { if (!tossup) { return res.sendStatus(404); } const description = `Tossup: ${escapeHTML(removeParentheses(tossup.answer_sanitized))} [${tossup.set.name}]`; - const file = fs.readFileSync('./client/db/tossup/index.html', { encoding: 'utf8' }); res.send(file.replace('', ``)); }); From 311058e9cf99e55601a17dba1c48a13dcbb848b9 Mon Sep 17 00:00:00 2001 From: Geoffrey Wu Date: Tue, 24 Mar 2026 21:44:05 -0400 Subject: [PATCH 3/4] Update bonus.js --- routes/db/bonus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/db/bonus.js b/routes/db/bonus.js index 046b72bee..1a134c942 100644 --- a/routes/db/bonus.js +++ b/routes/db/bonus.js @@ -9,7 +9,7 @@ const router = Router(); const head = fs.readFileSync('./client/head.html', 'utf8'); const nav = fs.readFileSync('./client/nav/index.html', 'utf8'); -const file = fs.readFileSync('./client/db/bonus/index.html', { encoding: 'utf8' }) +const file = fs.readFileSync('./client/db/bonus/index.html', 'utf8') .replace('', head) .replace('', nav); From aaf0e89762c057458387ed142432b39428c1d008 Mon Sep 17 00:00:00 2001 From: Geoffrey Wu Date: Tue, 24 Mar 2026 21:46:10 -0400 Subject: [PATCH 4/4] Update tossup.js --- routes/db/tossup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/db/tossup.js b/routes/db/tossup.js index e81cdb282..06e2d3d07 100644 --- a/routes/db/tossup.js +++ b/routes/db/tossup.js @@ -9,7 +9,7 @@ const router = Router(); const head = fs.readFileSync('./client/head.html', 'utf8'); const nav = fs.readFileSync('./client/nav/index.html', 'utf8'); -const file = fs.readFileSync('./client/db/tossup/index.html', { encoding: 'utf8' }) +const file = fs.readFileSync('./client/db/tossup/index.html', 'utf8') .replace('', head) .replace('', nav);