mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
problem: fix file:// match
This commit is contained in:
1 file changed
+1
-1
@@ -400,7 +400,7 @@ export class ProblemDetailHandler extends ContestDetailBaseHandler {
|
|||||||
if (!this.request.json || args[2]) {
|
if (!this.request.json || args[2]) {
|
||||||
this.response.body.pdoc.content = this.response.body.pdoc.content
|
this.response.body.pdoc.content = this.response.body.pdoc.content
|
||||||
.replace(/file:\/\/([^ \n)\\"]+?)/g, (str) => {
|
.replace(/file:\/\/([^ \n)\\"]+?)/g, (str) => {
|
||||||
const info = str.match(/\]\(file:\/\/(.+?)\)/);
|
const info = str.match(/file:\/\/([^ \n)\\"]+?)/);
|
||||||
const fileinfo = info[1];
|
const fileinfo = info[1];
|
||||||
const filename = fileinfo.split('?')[0]; // remove querystring
|
const filename = fileinfo.split('?')[0]; // remove querystring
|
||||||
if (!this.pdoc.additional_file?.find((i) => i.name === filename)) return str;
|
if (!this.pdoc.additional_file?.find((i) => i.name === filename)) return str;
|
||||||
|
|||||||
Reference in new issue
Block a user