fix multiple lines output and color scheme

This commit is contained in:
Xuan Son Nguyen 2025-02-08 15:16:26 +01:00
parent 19a95daf78
commit 22e826336a
3 changed files with 12 additions and 4 deletions

Binary file not shown.

View file

@ -36,7 +36,7 @@ const PyodideWrapper = {
if (result) {
stdOutAndErr.push(result.toString());
}
return stdOutAndErr.join('');
return stdOutAndErr.join('\n');
},
};
@ -102,9 +102,11 @@ export default function CanvasPyInterpreter() {
{running ? 'Running...' : 'Run'}
</button>
</div>
<pre className="bg-slate-900 rounded-md grow text-gray-200 p-3 whitespace-pre-wrap overflow-auto">
{output}
</pre>
<textarea
className="textarea textarea-bordered h-full dark-color"
value={output}
readOnly
></textarea>
</div>
</div>
</div>

View file

@ -45,6 +45,9 @@
/* Highlight.js */
[data-color-scheme='light'] {
@include meta.load-css('highlight.js/styles/stackoverflow-light');
.dark-color {
@apply bg-base-content text-base-100;
}
}
[data-color-scheme='dark'] {
@include meta.load-css('highlight.js/styles/stackoverflow-dark');
@ -52,6 +55,9 @@
[data-color-scheme='auto'] {
@media (prefers-color-scheme: light) {
@include meta.load-css('highlight.js/styles/stackoverflow-light');
.dark-color {
@apply bg-base-content text-base-100;
}
}
@media (prefers-color-scheme: dark) {
@include meta.load-css('highlight.js/styles/stackoverflow-dark');