This commit is contained in:
retoor 2026-03-15 18:40:39 +01:00
parent ba92318497
commit 583d6dd5d1
2 changed files with 39 additions and 3 deletions

View File

@ -860,6 +860,41 @@ dialog .dialog-button.danger:disabled {
margin-top: 10px; margin-top: 10px;
} }
th { .message-content table {
min-width: 100px; border-collapse: collapse;
width: 100%;
margin: 8px 0;
font-size: 0.9em;
background-color: var(--bg-secondary, #1e1e1e);
border-radius: 6px;
overflow: hidden;
}
.message-content thead th {
background-color: var(--accent-color, #f05a28);
color: #fff;
font-weight: 600;
text-align: left;
padding: 10px 14px;
min-width: 100px;
border: none;
}
.message-content tbody td {
padding: 8px 14px;
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
color: #e6e6e6;
}
.message-content tbody tr:nth-child(even) {
background-color: rgba(255, 255, 255, 0.03);
}
.message-content tbody tr:hover {
background-color: rgba(240, 90, 40, 0.08);
}
.message-content .table-wrapper {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
} }

View File

@ -7,6 +7,7 @@ from app.cache import time_cache_async, time_cache
from mistune import HTMLRenderer, Markdown from mistune import HTMLRenderer, Markdown
from mistune.plugins.formatting import strikethrough from mistune.plugins.formatting import strikethrough
from mistune.plugins.spoiler import spoiler from mistune.plugins.spoiler import spoiler
from mistune.plugins.table import table
from mistune.plugins.url import url from mistune.plugins.url import url
from pygments import highlight from pygments import highlight
from pygments.formatters import html from pygments.formatters import html
@ -80,7 +81,7 @@ class MarkdownRenderer(HTMLRenderer):
def render_markdown_sync(app, markdown_string): def render_markdown_sync(app, markdown_string):
renderer = MarkdownRenderer(app, None) renderer = MarkdownRenderer(app, None)
markdown = Markdown(renderer=renderer, plugins=[url, strikethrough, spoiler]) markdown = Markdown(renderer=renderer, plugins=[url, strikethrough, spoiler, table])
return markdown(markdown_string) return markdown(markdown_string)