mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: fix #908
This commit is contained in:
1 file changed
+3
-3
@@ -48,7 +48,7 @@ export function buildContent(source: ProblemSource, type: 'markdown' | 'html' =
|
|||||||
...source.description ? [`<h2>${_('Description')}</h2>`, source.description] : [],
|
...source.description ? [`<h2>${_('Description')}</h2>`, source.description] : [],
|
||||||
...source.input ? [`<h2>${_('Input Format')}</h2>`, source.input] : [],
|
...source.input ? [`<h2>${_('Input Format')}</h2>`, source.input] : [],
|
||||||
...source.output ? [`<h2>${_('Output Format')}</h2>`, source.output] : [],
|
...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}">`,
|
`<pre><code class="language-input${i + 1}">`,
|
||||||
sample[0],
|
sample[0],
|
||||||
`</code></pre><pre><code class="language-output${i + 1}">`,
|
`</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.description ? [`## ${_('Description')}`, '', source.description, ''] : [],
|
||||||
...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 || []).flatMap((sample, i) => [
|
||||||
`\`\`\`input${i + 1}`,
|
`\`\`\`input${i + 1}`,
|
||||||
sample[0],
|
sample[0],
|
||||||
'```',
|
'```',
|
||||||
`\`\`\`output${i + 1}`,
|
`\`\`\`output${i + 1}`,
|
||||||
sample[1],
|
sample[1],
|
||||||
'```',
|
'```',
|
||||||
].join('\n')),
|
]),
|
||||||
...source.samplesRaw ? [source.samplesRaw] : [],
|
...source.samplesRaw ? [source.samplesRaw] : [],
|
||||||
...source.hint ? [`## ${_('Hint')}`, '', source.hint, ''] : [],
|
...source.hint ? [`## ${_('Hint')}`, '', source.hint, ''] : [],
|
||||||
...source.source ? [`## ${_('Source')}`, '', source.source, ''] : [],
|
...source.source ? [`## ${_('Source')}`, '', source.source, ''] : [],
|
||||||
|
|||||||
Reference in new issue
Block a user