@@ -3,18 +3,13 @@ import { getNames } from '@vitest/ws-client'
3
3
import { client , currentLogs as logs } from ' ~/composables/client'
4
4
import { isDark } from ' ~/composables/dark'
5
5
import { createAnsiToHtmlFilter } from ' ~/composables/error'
6
+ import { escapeHtml } from " ~/utils/escape"
6
7
7
8
const formattedLogs = computed (() => {
8
9
const data = logs .value
9
10
if (data ) {
10
11
const filter = createAnsiToHtmlFilter (isDark .value )
11
- return data .map (({ taskId , type , time , content }) => {
12
- const trimmed = content .trim ()
13
- const value = filter .toHtml (trimmed )
14
- return value !== trimmed
15
- ? { taskId , type , time , html: true , content: value }
16
- : { taskId , type , time , html: false , content }
17
- })
12
+ return data .map (({ taskId , type , time , content }) => ({ taskId , type , time , content: filter .toHtml (escapeHtml (content )) }))
18
13
}
19
14
})
20
15
@@ -26,13 +21,12 @@ function getTaskName(id?: string) {
26
21
27
22
<template >
28
23
<div v-if =" formattedLogs?.length" h-full class =" scrolls" flex flex-col data-testid =" logs" >
29
- <div v-for =" { taskId, type, time, html, content } of formattedLogs" :key =" taskId" font-mono >
24
+ <div v-for =" { taskId, type, time, content } of formattedLogs" :key =" taskId" font-mono >
30
25
<ViewConsoleOutputEntry
31
26
:task-name =" getTaskName(taskId)"
32
27
:type =" type"
33
28
:time =" time"
34
29
:content =" content"
35
- :html =" html"
36
30
/>
37
31
</div >
38
32
</div >
0 commit comments