From 6d37f5a1326d774ca3154b2b312ae14c280f413d Mon Sep 17 00:00:00 2001 From: undefined Date: Fri, 15 Dec 2023 12:35:51 +0800 Subject: [PATCH] problem: fix file:// match --- packages/hydrooj/src/handler/problem.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hydrooj/src/handler/problem.ts b/packages/hydrooj/src/handler/problem.ts index b161afca3..cced852c1 100644 --- a/packages/hydrooj/src/handler/problem.ts +++ b/packages/hydrooj/src/handler/problem.ts @@ -400,7 +400,7 @@ export class ProblemDetailHandler extends ContestDetailBaseHandler { if (!this.request.json || args[2]) { this.response.body.pdoc.content = this.response.body.pdoc.content .replace(/file:\/\/([^ \n)\\"]+?)/g, (str) => { - const info = str.match(/\]\(file:\/\/(.+?)\)/); + const info = str.match(/file:\/\/([^ \n)\\"]+?)/); const fileinfo = info[1]; const filename = fileinfo.split('?')[0]; // remove querystring if (!this.pdoc.additional_file?.find((i) => i.name === filename)) return str;