This commit is contained in:
undefined committed 2021-01-08 13:49:57 +08:00
1 parent 252a251ce4
commit ba94c59e3f
2 files changed
+8 -3

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.15.12",
"version": "2.15.13",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
+7 -2
View File
@@ -194,8 +194,13 @@ export class ProblemDetailHandler extends ProblemHandler {
async get(..._args: any[]) {
// Navigate to current additional file download
// e.g. ![img](a.jpg) will navigate to ![img](./pid/file/a.jpg)
this.response.body.pdoc.content = this.response.body.pdoc.content
.replace(/\(file:\/\//g, `(./${this.pdoc.docId}/file/`);
if (typeof this.response.body.pdoc.content === 'string') {
this.response.body.pdoc.content = this.response.body.pdoc.content
.replace(/\(file:\/\//g, `(./${this.pdoc.docId}/file/`);
} else {
this.response.body.pdoc.content = JSON.parse(JSON.stringify(this.response.body.pdoc.content)
.replace(/\(file:\/\//g, `(./${this.pdoc.docId}/file/`));
}
}
@param('pid', Types.UnsignedInt)