feat: Markdown 工具栏编辑器与服务端预览

共用 md_editor 于发帖/改帖/评论,扩展 ComposeBodyToHTML,并提供 /compose/preview。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-30 04:50:07 +08:00
parent 7f048bd9b5
commit 1f777eebb1
17 changed files with 1056 additions and 232 deletions

View File

@@ -218,7 +218,19 @@
<input type="hidden" name="reply_to" id="comment-reply-to" value=""/>
<p class="j13-muted j13-comment-reply-hint" id="comment-reply-hint" hidden></p>
<label for="comment-content">发表评论</label>
<textarea id="comment-content" name="content" rows="4" required maxlength="8000"></textarea>
{{template "shared/md_editor" (dict
"Name" "content"
"ID" "comment-content"
"Content" ""
"Rows" 5
"MaxLength" 8000
"Placeholder" "支持 Markdown可回复楼上"
"CSRF" .CSRF
"ShowGates" 0
"ShowUpload" 1
"Unsaved" 0
"Required" 1
)}}
<label class="j13-check">
<input type="checkbox" name="is_private" value="1"/>
私密评论(仅相关可见)