|
1 | 1 | <script lang="ts"> |
2 | 2 | import type { PageData } from "./$types"; |
3 | 3 | import type { PublicInvestigationResult } from "./+page.server"; |
| 4 | + import { renderClaimReasoningHtml } from "$lib/claim-markdown"; |
4 | 5 |
|
5 | 6 | const { data }: { data: PageData } = $props(); |
6 | 7 |
|
|
120 | 121 |
|
121 | 122 | <details class="claim-details"> |
122 | 123 | <summary>Full reasoning</summary> |
123 | | - <div class="reasoning">{claim.reasoning}</div> |
| 124 | + <!-- eslint-disable-next-line svelte/no-at-html-tags --> |
| 125 | + <div class="reasoning">{@html renderClaimReasoningHtml(claim.reasoning)}</div> |
124 | 126 | </details> |
125 | 127 |
|
126 | 128 | {#if claim.sources.length > 0} |
|
364 | 366 | margin-top: 0.5rem; |
365 | 367 | padding-left: 0.75rem; |
366 | 368 | border-left: 2px solid var(--color-border); |
367 | | - white-space: pre-wrap; |
| 369 | + } |
| 370 | +
|
| 371 | + .reasoning :global(p) { |
| 372 | + margin: 0 0 0.875rem; |
| 373 | + } |
| 374 | +
|
| 375 | + .reasoning :global(p:last-child) { |
| 376 | + margin-bottom: 0; |
| 377 | + } |
| 378 | +
|
| 379 | + .reasoning :global(h1), |
| 380 | + .reasoning :global(h2), |
| 381 | + .reasoning :global(h3), |
| 382 | + .reasoning :global(h4) { |
| 383 | + color: var(--color-text); |
| 384 | + font-weight: 600; |
| 385 | + line-height: 1.4; |
| 386 | + margin: 1rem 0 0.5rem; |
| 387 | + } |
| 388 | +
|
| 389 | + .reasoning :global(h1) { |
| 390 | + font-size: 1.1rem; |
| 391 | + } |
| 392 | +
|
| 393 | + .reasoning :global(h2) { |
| 394 | + font-size: 1rem; |
| 395 | + } |
| 396 | +
|
| 397 | + .reasoning :global(h3), |
| 398 | + .reasoning :global(h4) { |
| 399 | + font-size: 0.9375rem; |
| 400 | + } |
| 401 | +
|
| 402 | + .reasoning :global(ul), |
| 403 | + .reasoning :global(ol) { |
| 404 | + margin: 0.5rem 0 0.875rem 1.25rem; |
| 405 | + padding: 0; |
| 406 | + } |
| 407 | +
|
| 408 | + .reasoning :global(li) { |
| 409 | + margin-bottom: 0.375rem; |
| 410 | + } |
| 411 | +
|
| 412 | + .reasoning :global(a) { |
| 413 | + color: var(--color-accent); |
| 414 | + } |
| 415 | +
|
| 416 | + .reasoning :global(a:hover) { |
| 417 | + text-decoration: underline; |
| 418 | + } |
| 419 | +
|
| 420 | + .reasoning :global(code) { |
| 421 | + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; |
| 422 | + font-size: 0.8125rem; |
| 423 | + padding: 0.125rem 0.25rem; |
| 424 | + border-radius: 4px; |
| 425 | + background: var(--color-bg); |
| 426 | + color: var(--color-text); |
| 427 | + } |
| 428 | +
|
| 429 | + .reasoning :global(pre) { |
| 430 | + overflow-x: auto; |
| 431 | + padding: 0.75rem; |
| 432 | + border-radius: 8px; |
| 433 | + background: var(--color-bg); |
| 434 | + border: 1px solid var(--color-border); |
| 435 | + margin: 0.75rem 0; |
| 436 | + } |
| 437 | +
|
| 438 | + .reasoning :global(pre code) { |
| 439 | + background: transparent; |
| 440 | + padding: 0; |
368 | 441 | } |
369 | 442 |
|
370 | 443 | /* Sources */ |
|
0 commit comments