Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 13 commits into from
Feb 6, 2024

Conversation

taoky
Copy link
Contributor

@taoky taoky commented Feb 4, 2024

参考了 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
Copy link
Collaborator

bojieli commented Feb 6, 2024

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

@bojieli
Copy link
Collaborator

bojieli commented Feb 6, 2024

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
Copy link
Collaborator

bojieli commented Feb 6, 2024

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
Copy link
Collaborator

bojieli commented Feb 6, 2024

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).

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.

None yet

2 participants