From 471ff3153bcaf6d5fe3dcffc6648e0e3508e8563 Mon Sep 17 00:00:00 2001 From: aba2222 Date: Mon, 13 Jul 2026 08:37:31 +0800 Subject: [PATCH 1/7] use new markdown editor --- forum/markdown.py | 2 +- forum/templates/forum/comment_edit.html | 1 - forum/templates/forum/post_create.html | 1 - forum/templates/forum/post_detail.html | 1 - forum/templates/forum/post_edit.html | 1 - lean_forum/settings.py | 2 +- md_editor/__init__.py | 0 md_editor/apps.py | 5 +++++ md_editor/models.py | 18 ++++++++++++++++++ md_editor/static/md_editor/index.css | 1 + md_editor/static/md_editor/index.js | 18 ++++++++++++++++++ md_editor/templates/md_editor.html | 11 +++++++++++ md_editor/widgets.py | 18 ++++++++++++++++++ 13 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 md_editor/__init__.py create mode 100644 md_editor/apps.py create mode 100644 md_editor/models.py create mode 100644 md_editor/static/md_editor/index.css create mode 100644 md_editor/static/md_editor/index.js create mode 100644 md_editor/templates/md_editor.html create mode 100644 md_editor/widgets.py diff --git a/forum/markdown.py b/forum/markdown.py index 6409cac..7960e6f 100644 --- a/forum/markdown.py +++ b/forum/markdown.py @@ -1,6 +1,6 @@ from django.db import models -from mdeditor.fields import MDTextField +from md_editor.models import MDTextField import markdown import bleach diff --git a/forum/templates/forum/comment_edit.html b/forum/templates/forum/comment_edit.html index 5f6d2d6..10351da 100644 --- a/forum/templates/forum/comment_edit.html +++ b/forum/templates/forum/comment_edit.html @@ -9,7 +9,6 @@

编辑评论

{% csrf_token %} - {{ form.media }} {{ form.as_p }}