Style changes in job trace spans multiple lines

We have recently fixed the performance issues with the job traces but we introduced a bug in the way we display ANSI style changes:

See: https://gitlab.com/gitlab-org/gitlab-runner/-/jobs/266684199

image

I think the problem is related to the display-block CSS added to span.line tag: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31262/diffs#48e8c3d5c18366cf8ac1f0dc1446e8b03bb7868b_130_130

One solution could be to translate style changes to <span> without line class but ensure that the whole line is wrapped inside a <span class="line ...">.