core: fix pdoc get

This commit is contained in:
undefined committed 2021-04-07 16:16:20 +08:00
1 parent 30f82ae82b
commit cb91c6ba71
4 files changed
+8 -8

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.21.16",
"version": "2.21.17",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
+4 -4
View File
@@ -266,10 +266,6 @@ class ContestProblemHandler extends ContestHandler {
[this.tdoc.title, 'contest_detail', { tid: this.tdoc.docId }, true],
[this.pdoc.title, null, null, true],
];
// 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/`);
this.response.body = {
tdoc: this.tdoc,
pdoc: this.pdoc,
@@ -279,6 +275,10 @@ class ContestProblemHandler extends ContestHandler {
path,
page_name: 'contest_detail_problem',
};
// 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/`);
}
}