refac/fix: codeblock

This commit is contained in:
Timothy Jaeryang Baek 2025-09-15 15:02:19 -05:00
parent c744ae0d63
commit 0e5320c39e

View file

@ -167,9 +167,9 @@
]; ];
} }
if (stdout.startsWith(`${line}\n`)) { if (stdout.includes(`${line}\n`)) {
stdout = stdout.replace(`${line}\n`, ``); stdout = stdout.replace(`${line}\n`, ``);
} else if (stdout.startsWith(`${line}`)) { } else if (stdout.includes(`${line}`)) {
stdout = stdout.replace(`${line}`, ``); stdout = stdout.replace(`${line}`, ``);
} }
} }
@ -196,9 +196,9 @@
]; ];
} }
if (result.startsWith(`${line}\n`)) { if (result.includes(`${line}\n`)) {
result = result.replace(`${line}\n`, ``); result = result.replace(`${line}\n`, ``);
} else if (result.startsWith(`${line}`)) { } else if (result.includes(`${line}`)) {
result = result.replace(`${line}`, ``); result = result.replace(`${line}`, ``);
} }
} }
@ -275,9 +275,9 @@
]; ];
} }
if (stdout.startsWith(`${line}\n`)) { if (stdout.includes(`${line}\n`)) {
stdout = stdout.replace(`${line}\n`, ``); stdout = stdout.replace(`${line}\n`, ``);
} else if (stdout.startsWith(`${line}`)) { } else if (stdout.includes(`${line}`)) {
stdout = stdout.replace(`${line}`, ``); stdout = stdout.replace(`${line}`, ``);
} }
} }
@ -454,7 +454,7 @@
{#if ($config?.features?.enable_code_execution ?? true) && (lang.toLowerCase() === 'python' || lang.toLowerCase() === 'py' || (lang === '' && checkPythonCode(code)))} {#if ($config?.features?.enable_code_execution ?? true) && (lang.toLowerCase() === 'python' || lang.toLowerCase() === 'py' || (lang === '' && checkPythonCode(code)))}
{#if executing} {#if executing}
<div class="run-code-button bg-none border-none p-1 cursor-not-allowed"> <div class="run-code-button bg-none border-none p-0.5 cursor-not-allowed">
{$i18n.t('Running')} {$i18n.t('Running')}
</div> </div>
{:else if run} {:else if run}
@ -466,10 +466,6 @@
executePython(code); executePython(code);
}} }}
> >
<div class=" -translate-y-[0.5px]">
<CommandLine className="size-3" />
</div>
<div> <div>
{$i18n.t('Run')} {$i18n.t('Run')}
</div> </div>
@ -541,7 +537,7 @@
{/if} {/if}
{:else} {:else}
<div <div
class="bg-gray-50 dark:bg-black dark:text-white rounded-b-3xl! pb-3 px-4 flex flex-col gap-2 text-xs" class="bg-white dark:bg-black dark:text-white rounded-b-3xl! pb-3 px-4 flex flex-col gap-2 text-xs"
> >
<span class="text-gray-500 italic"> <span class="text-gray-500 italic">
{$i18n.t('{{COUNT}} hidden lines', { {$i18n.t('{{COUNT}} hidden lines', {