feat(ui): render assistant replies as Markdown
This commit is contained in:
@@ -2772,6 +2772,103 @@ button[data-reports-sidebar-toggle] {
|
||||
}
|
||||
.hist-msg.user .hist-body.partial { opacity: 0.68; }
|
||||
|
||||
/* Markdown is confined to assistant message bodies in both themes. */
|
||||
.markdown-content {
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
white-space: normal !important;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.markdown-content > :first-child { margin-top: 0; }
|
||||
.markdown-content > :last-child { margin-bottom: 0; }
|
||||
.markdown-content p { margin: 0 0 0.75em; }
|
||||
.markdown-content strong { font-weight: 700; }
|
||||
.markdown-content :is(h1, h2, h3, h4, h5, h6) {
|
||||
margin: 1em 0 0.5em;
|
||||
font-size: 1.12em;
|
||||
font-weight: 700;
|
||||
line-height: 1.35;
|
||||
}
|
||||
.markdown-content :is(ul, ol) {
|
||||
margin: 0.65em 0;
|
||||
padding-inline-start: 1.5em;
|
||||
}
|
||||
.markdown-content ul { list-style-type: disc; }
|
||||
.markdown-content ol { list-style-type: decimal; }
|
||||
.markdown-content li + li { margin-top: 0.35em; }
|
||||
.markdown-content li > p { margin: 0.25em 0; }
|
||||
.markdown-content li :is(ul, ol) { margin: 0.3em 0; }
|
||||
.markdown-content a {
|
||||
color: var(--brand-3);
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 0.15em;
|
||||
}
|
||||
html[data-theme="white"] .markdown-content a { color: #1d4ed8; }
|
||||
.markdown-content :is(a, pre, .markdown-table):focus-visible {
|
||||
outline: 2px solid var(--brand);
|
||||
outline-offset: 3px;
|
||||
}
|
||||
.markdown-content blockquote {
|
||||
margin: 0.75em 0;
|
||||
padding-inline-start: 12px;
|
||||
border-inline-start: 3px solid var(--brand);
|
||||
color: var(--text-dim);
|
||||
}
|
||||
.markdown-content code {
|
||||
padding: 0.15em 0.35em;
|
||||
border-radius: 4px;
|
||||
background: color-mix(in srgb, currentColor 8%, transparent);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.markdown-content pre {
|
||||
max-width: 100%;
|
||||
margin: 0.75em 0;
|
||||
padding: 12px;
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 8px;
|
||||
overflow: auto;
|
||||
white-space: pre;
|
||||
}
|
||||
.markdown-content pre code {
|
||||
display: block;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
white-space: pre;
|
||||
overflow-wrap: normal;
|
||||
word-break: normal;
|
||||
}
|
||||
.markdown-content hr {
|
||||
margin: 1em 0;
|
||||
border: 0;
|
||||
border-top: 1px solid var(--border-strong);
|
||||
}
|
||||
.markdown-content img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.markdown-content .markdown-table {
|
||||
max-width: 100%;
|
||||
margin: 0.75em 0;
|
||||
overflow-x: auto;
|
||||
overscroll-behavior-x: contain;
|
||||
}
|
||||
.markdown-content table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 0.92em;
|
||||
}
|
||||
.markdown-content :is(th, td) {
|
||||
padding: 7px 10px;
|
||||
border: 1px solid var(--border-strong);
|
||||
text-align: start;
|
||||
vertical-align: top;
|
||||
}
|
||||
.markdown-content th { font-weight: 700; }
|
||||
.markdown-content [align="center"] { text-align: center; }
|
||||
.markdown-content [align="right"] { text-align: end; }
|
||||
|
||||
/* ─── Tool call history item ─────────────────────────────────────────── */
|
||||
|
||||
.hist-tool-header {
|
||||
|
||||
Reference in New Issue
Block a user