Allow image uploads in lesson comments

Add an image button to the comment toolbar backed by a new upload route
(images only, 5 MB, stored under comments/<userId>/), inserted as Markdown.

Only images served from our own storage are rendered: a third-party src would
be fetched by every reader of the lesson, exposing their address. Such links
are shown as plain links instead — this also defuses the external images a few
existing comments already carry.
This commit is contained in:
2026-08-06 11:41:19 +05:00
parent 917253990b
commit 005cd329b2
4 changed files with 138 additions and 5 deletions
+7
View File
@@ -243,6 +243,13 @@
}
/* Markdown-разметка в комментариях под уроками (react-markdown) */
.comment-md img {
display: block;
max-width: 100%;
height: auto;
margin: 0.5rem 0;
border: 2px solid var(--border);
}
.comment-md > :first-child { margin-top: 0; }
.comment-md > :last-child { margin-bottom: 0; }
.comment-md p { margin: 0 0 0.5rem; }