Fix newlines in logs (#3808)

This commit is contained in:
qwerty287 2024-06-21 10:13:59 +02:00 committed by GitHub
parent 1a39d57f71
commit d7028cfbef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -184,7 +184,7 @@ function writeLog(line: Partial<LogLine>) {
logBuffer.value.push({
index: line.index ?? 0,
number: (line.index ?? 0) + 1,
text: ansiUp.value.ansi_to_html(decode(line.text ?? '')),
text: ansiUp.value.ansi_to_html(`${decode(line.text ?? '')}\n`),
time: line.time ?? 0,
type: null, // TODO: implement way to detect errors and warnings
});
@ -254,7 +254,7 @@ async function download() {
downloadInProgress.value = false;
}
const fileURL = window.URL.createObjectURL(
new Blob([logs.map((line) => decode(line.data)).join('')], {
new Blob([logs.map((line) => decode(line.data ?? '')).join('\n')], {
type: 'text/plain',
}),
);