core: update buildContent

This commit is contained in:
undefined committed 2021-06-14 22:53:31 +08:00
1 parent 7bd7325db6
commit 308605f884
3 files changed
+46 -13

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.28.35",
"version": "2.28.36",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
+2 -1
View File
@@ -17,7 +17,8 @@ export function buildContent(source: ProblemSource | ContentNode[], type: 'markd
? source.map((node) => [
node.type !== 'Plain' ? `<h2>${node.sectionTitle}</h2>` : '',
node.type === 'Sample'
? `<h2>${_('Sample Input')}<h2><pre>${node.payload[0]}</pre><h2>${_('Sample Output')}</h2><pre>${node.payload[1]}</pre>`
? `<pre><code class="language-input${++cnt}">${node.payload[0]}</code></pre>`
+ `<pre><code class="language-output${cnt}">${node.payload[1]}</code></pre>`
: '',
node.text,
].join('\n')).join('\n')