diff --git a/src/lib/utils/code.ts b/src/lib/utils/code.ts index c718543a018..87503c1066a 100644 --- a/src/lib/utils/code.ts +++ b/src/lib/utils/code.ts @@ -136,7 +136,7 @@ export const getCodeHtml = (args: Args) => { return carry; }, ''); - return `
${final}
`; }; diff --git a/src/markdoc/nodes/Fence.svelte b/src/markdoc/nodes/Fence.svelte index 04415fdf067..184e6b35499 100644 --- a/src/markdoc/nodes/Fence.svelte +++ b/src/markdoc/nodes/Fence.svelte @@ -6,6 +6,7 @@ import { platformMap, preferredPlatform } from '$lib/utils/references'; import '$scss/hljs.css'; import { melt } from '@melt-ui/svelte'; + import { isInChangelog } from '../layouts/Changelog.svelte'; import { getContext, hasContext } from 'svelte'; import { get } from 'svelte/store'; import type { CodeContext } from '../tags/MultiCode.svelte'; @@ -29,6 +30,7 @@ }: FenceProps = $props(); const inTutorialDocs = isInTutorialDocs(); + const inChangelog = isInChangelog(); const insideMultiCode = hasContext('multi-code'); const selected = insideMultiCode ? getContext('multi-code').selected : null; @@ -93,6 +95,7 @@ {:else}
@@ -137,4 +140,24 @@ .no-top-margin { margin-top: unset !important; } + + .in-changelog { + max-width: 100%; + } + + .in-changelog .web-code-snippet-content { + max-width: 100%; + overflow-x: auto; + overscroll-behavior-x: contain; + } + + .in-changelog :global(.web-code-pre) { + max-width: 100%; + overflow-x: auto; + } + + .in-changelog :global(.web-code-body.line-numbers) { + display: block; + min-width: max-content; + } diff --git a/src/routes/changelog/ChangelogEntry.svelte b/src/routes/changelog/ChangelogEntry.svelte index 4d07eae78e0..e5a7831d4bc 100644 --- a/src/routes/changelog/ChangelogEntry.svelte +++ b/src/routes/changelog/ChangelogEntry.svelte @@ -6,7 +6,7 @@ export let entry: PageData['entries'][0]; -