core: fix buildContent display

This commit is contained in:
undefined committed 2021-05-08 21:19:19 +08:00
1 parent df66659c5f
commit 5b0478fb3f
2 files changed
+3 -7

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "2.25.4", "version": "2.25.5",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "dist/loader.js", "main": "dist/loader.js",
"typings": "dist/loader.d.ts", "typings": "dist/loader.d.ts",
+2 -6
View File
@@ -25,11 +25,9 @@ export function buildContent(source: ProblemSource | ContentNode[], type: 'markd
node.type !== 'Plain' ? `## ${node.sectionTitle}` : '', node.type !== 'Plain' ? `## ${node.sectionTitle}` : '',
...node.type === 'Sample' ...node.type === 'Sample'
? [ ? [
`## ${_('Sample Input')}`,
`\`\`\`input${++cnt}`, `\`\`\`input${++cnt}`,
node.payload[0], node.payload[0],
'```', '```',
`## ${_('Sample Output')}`,
`\`\`\`output${cnt}`, `\`\`\`output${cnt}`,
node.payload[1], node.payload[1],
'```', '```',
@@ -58,12 +56,10 @@ export function buildContent(source: ProblemSource | ContentNode[], type: 'markd
...source.input ? [`## ${_('Input Format')}`, source.input] : [], ...source.input ? [`## ${_('Input Format')}`, source.input] : [],
...source.output ? [`## '${_('Output Format')}`, source.output] : [], ...source.output ? [`## '${_('Output Format')}`, source.output] : [],
...(source.samples).map((sample, i) => [ ...(source.samples).map((sample, i) => [
`## ${_('Sample Input')} ${i + 1}`, `\`\`\`input${i + 1}`,
'```',
sample[0], sample[0],
'```', '```',
`## ${_('Sample Output')} ${i + 1}`, `\`\`\`output${i + 1}`,
'```',
sample[1], sample[1],
'```', '```',
].join('\n')), ].join('\n')),