Enrich lesson comments: Markdown formatting, edit, higher limit

Add a formatting toolbar + safe Markdown rendering (react-markdown +
rehype-sanitize), raise the length limit 2000 -> 10000, and let authors
edit their own comments (new editComment action + editedAt column shown
as an 'изменено' badge).
This commit is contained in:
2026-07-31 19:35:58 +05:00
parent 08e212365d
commit 2498d0f8da
7 changed files with 859 additions and 134 deletions
+32
View File
@@ -241,3 +241,35 @@
border-left-color: #E8F0D8;
background-color: var(--sidebar-surface);
}
/* Markdown-разметка в комментариях под уроками (react-markdown) */
.comment-md > :first-child { margin-top: 0; }
.comment-md > :last-child { margin-bottom: 0; }
.comment-md p { margin: 0 0 0.5rem; }
.comment-md strong { font-weight: 700; }
.comment-md em { font-style: italic; }
.comment-md a { color: var(--foreground); text-decoration: underline; text-underline-offset: 2px; }
.comment-md ul { list-style: disc; padding-left: 1.4rem; margin: 0 0 0.5rem; }
.comment-md ol { list-style: decimal; padding-left: 1.4rem; margin: 0 0 0.5rem; }
.comment-md li { margin: 0.15rem 0; }
.comment-md blockquote {
border-left: 2px solid var(--border);
padding-left: 0.75rem;
margin: 0 0 0.5rem;
color: var(--muted-foreground);
}
.comment-md code {
font-family: var(--font-mono, monospace);
font-size: 0.9em;
background: var(--color-surface);
padding: 0.05rem 0.3rem;
border-radius: 2px;
}
.comment-md pre {
background: var(--color-surface);
padding: 0.6rem 0.75rem;
border-radius: 2px;
overflow-x: auto;
margin: 0 0 0.5rem;
}
.comment-md pre code { background: none; padding: 0; }