Skip to content
Closed
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/fix-web-fallback-line-numbers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

web: Fix line numbers overlapping or drifting out of alignment in fallback-rendered code blocks.
33 changes: 33 additions & 0 deletions apps/kimi-web/src/components/chat/Markdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,39 @@ function copyDiff(code: string, idx: number) {
.md :deep(.code-block-content pre:not(.shiki) code) {
color: var(--color-text);
}
/* markstream-vue 1.0.7 renders its standalone fallback as the component root,
but scopes the corresponding styles as though the <pre> were a descendant.
Restore that fallback layout here; loading fallbacks already receive the
equivalent global markstream rule. */
.md :deep(pre.code-pre-fallback:not(.markstream-pre--diff-preview):not([data-markstream-code-loading='1'])) {
box-sizing: border-box;
width: 100%;
margin: 0.6em 0;
padding: var(--markstream-code-padding-y, 8px) var(--markstream-code-padding-x, 12px);
padding-left: var(--markstream-code-padding-left, 52px);
overflow: auto;
border: 1px solid var(--color-line);
border-radius: var(--radius-md);
background: var(--color-surface-sunken);
box-shadow: var(--shadow-xs);
color: var(--color-text);
font-family: var(--markstream-code-font-family, var(--font-mono));
font-size: var(--vscode-editor-font-size, var(--text-sm));
font-weight: var(--weight-regular);
line-height: var(--vscode-editor-line-height, calc(var(--text-sm) * 1.65));
}
.md :deep(pre.code-pre-fallback.is-wrap:not(.markstream-pre--diff-preview)) {
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.md :deep(pre.code-pre-fallback:not(.markstream-pre--diff-preview) > .markstream-pre__code) {
min-width: 100%;
padding: 0;
border: 0;
background: none;
color: inherit;
font: inherit;
}

/* Links — open in a new tab (markstream handles target/rel) */
.md :deep(a) {
Expand Down
Loading