Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix line breaks in comparison view #1552

Merged
merged 2 commits into from
Feb 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions report-viewer/src/components/fileDisplaying/CodePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
{{ getFileDisplayName(file) }}
</div>

<div class="mx-1 overflow-x-auto print:!mx-0">
<div class="mx-1 overflow-x-auto print:!mx-0 print:overflow-x-hidden">
<div class="print:display-initial w-fit min-w-full !text-xs" :class="{ hidden: collapsed }">
<table
v-if="file.data.trim() !== ''"
class="w-full"
class="w-full print:table-auto"
:aria-describedby="`Content of file ${file.fileName}`"
>
<!-- One row in table per code line -->
Expand All @@ -36,7 +36,7 @@
>
<pre
v-html="line.line"
class="code-font print-excact whitespace-pre-wrap !bg-transparent"
class="code-font print-excact break-child !bg-transparent print:whitespace-pre-wrap"
ref="lineRefs"
></pre>
</td>
Expand Down Expand Up @@ -145,4 +145,11 @@ function getFileDisplayName(file: SubmissionFile): string {
.code-font {
font-family: 'JetBrains Mono NL', monospace !important;
}

@media print {
.break-child *,
.break-child {
word-break: break-word;
}
}
</style>