Skip to content

升级富文本编辑器至 CKEditor 5 - #42

Merged
bojieli merged 13 commits into
USTC-iCourse:masterfrom
taoky:clean-deps-2
Feb 6, 2024
Merged

升级富文本编辑器至 CKEditor 5#42
bojieli merged 13 commits into
USTC-iCourse:masterfrom
taoky:clean-deps-2

Conversation

@taoky

@taoky taoky commented Feb 4, 2024

Copy link
Copy Markdown
Contributor

参考了 SUSTech-CRA 的 fork: https://github.com/SUSTech-CRA/sustech-course/blob/master/app/templates/ckeditor.html,添加了数学公式和文件上传,并且删除了移动端不使用富文本编辑器的限制。

文件上传部分的代码在 https://github.com/taoky/ckeditor5-file-upload

展示:

image

image

目前仍然有的问题是:

  • CKEditor5 的 DLL 导入需要引入大量的文件,这些文件还是放在仓库里提供吗?还是使用 CDN? 讨论结果是在仓库里提供。
  • 图片上传 API 删除了,因为 CKEditor5 没法区分不同的上传 adapter (See Custom Adapter for upload files ckeditor/ckeditor5#5999)
  • 需要检查与现有评论的兼容性

@bojieli

bojieli commented Feb 6, 2024

Copy link
Copy Markdown
Collaborator

Thanks a lot for your contributions! I will take a look into your pull request.

@bojieli

bojieli commented Feb 6, 2024

Copy link
Copy Markdown
Collaborator

I tested your PR. The new editor is really awesome. Basic editing and mathematical equations work well on both desktop and mobile. However the file and image upload does not work. I will take a look into this.

@bojieli

bojieli commented Feb 6, 2024

Copy link
Copy Markdown
Collaborator

I tested your PR. The new editor is really awesome. Basic editing and mathematical equations work well on both desktop and mobile. However the file and image upload does not work. I will take a look into this.

The file and image upload actually work. It was my fault in the configuration files.

The new editor works well in both desktop and mobile, and both Chrome and Safari.

However there is a small bug regarding the handling of tags. The tags are escaped correctly as < and >
It can be displayed correctly. However when I try to edit the review, the tags disappear from the content editor. I confirm that the backend returns the tags correctly. The rich text editor removes such tags.

Anyway this is a great contribution and I will merge your PR. Thanks a lot @taoky for your contributions.

Thanks @cuihaoleo for assisting in testing.

@bojieli
bojieli merged commit 47622f3 into USTC-iCourse:master Feb 6, 2024
@bojieli

bojieli commented Feb 6, 2024

Copy link
Copy Markdown
Collaborator

Another small problem: when I try to paste an URL into the editor, it does not work. However it works with other text (including rich text).

@bojieli bojieli mentioned this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants