This commit is contained in:
undefined committed 2024-11-17 23:28:49 +08:00
1 parent 53fc85ddd6
commit f177844336
1 file changed
+3 -3
+3 -3
View File
@@ -48,7 +48,7 @@ export function buildContent(source: ProblemSource, type: 'markdown' | 'html' =
...source.description ? [`<h2>${_('Description')}</h2>`, source.description] : [],
...source.input ? [`<h2>${_('Input Format')}</h2>`, source.input] : [],
...source.output ? [`<h2>${_('Output Format')}</h2>`, source.output] : [],
...(source.samples).map((sample, i) => [
...(source.samples || []).map((sample, i) => [
`<pre><code class="language-input${i + 1}">`,
sample[0],
`</code></pre><pre><code class="language-output${i + 1}">`,
@@ -63,14 +63,14 @@ export function buildContent(source: ProblemSource, type: 'markdown' | 'html' =
...source.description ? [`## ${_('Description')}`, '', source.description, ''] : [],
...source.input ? [`## ${_('Input Format')}`, '', source.input, ''] : [],
...source.output ? [`## ${_('Output Format')}`, '', source.output, ''] : [],
...(source.samples).map((sample, i) => [
...(source.samples || []).flatMap((sample, i) => [
`\`\`\`input${i + 1}`,
sample[0],
'```',
`\`\`\`output${i + 1}`,
sample[1],
'```',
].join('\n')),
]),
...source.samplesRaw ? [source.samplesRaw] : [],
...source.hint ? [`## ${_('Hint')}`, '', source.hint, ''] : [],
...source.source ? [`## ${_('Source')}`, '', source.source, ''] : [],