Blazorise
Blazorise copied to clipboard
Richtext: Replace QuillJs
Is your feature request related to a problem? Please describe.
I have several problems with QuillJs, but most annoying https://github.com/quilljs/quill/issues/1074 (quilljs cannot format text like <p>aa<br/>bb</p>
but instead outputs <p>aa</p><p><br /></p><p>bb</p>
). It would be perfect if blazorise abstracts different editors so we can choose the one that fits best for our needs.
Describe the solution you'd like Ideally, RichText does not allow just a single editor like QuillJs, but multiple ones. E.g. https://tiptap.dev/ seems very viable to me. Alternatively (but that's a breaking change), you may consider switching to a better editor than quilljs (most of the time, quill seems nice and good enough, but sometimes one need more possibilities and quill is very restrictive)
I like the idea of having everything abstracted. But since that would be a breaking change it will not come any time soon. For v2 or even v3, it would require some time to do. And possibly some existing APIs would have to be dropped in case other editor doesn't support them.
RoosterJS is a Microsoft supported Richtext editor. It's free and in my experience better than Quill. A downside is you need to make the editor toolbar yourself. But that could be templated, perhaps.
It also outputs HTML properly and also interfaces with MS word, Excel etc...
RoosterJS: https://github.com/microsoft/roosterjs
It's not very good-looking, but I like how it has so many features—going on the list.
This RoosterJS is indeed very promising. Since QuillJS isn't maintained anymore might be good to start looking at alternatives. Also a good alternative is TinyMCE, but that means we don't have to do anything because TinyMCE ships it's own blazor library.
The best would be to start a new extension Blazorise.RichTextEdit.Rooster
and deprecate the old RichTextEdit sometime in the future.
That's a good approach. Lately, I have been thinking of making extensions more similar to the Core library. Have them abstracted so that third-party libraries don't leak to the API.
For example:
-
Blazorise.RichTextEdit
only contains the API -
Blazorise.RichTextEdit.Rooster
-
Blazorise.RichTextEdit.Quill
Since it is a breaking change, it could only be done in v2.
for a v2 I would stop supporting Quill completely. I believe it has security leaks
Well, as long as be abstract good enough, users can choose the editor they want without breaking anything.
I'm working on getting roosterjs working. It's quite straightforward. I think it is not needed to include a RTE toolbar but just support the actions on the API so users can build\style their own toolbar. This will also reduce the complexity of the RTE component a lot. What do you think @stsrki?
@njannink In the long run; it would be good to have the API as close to what we currently have. But in any case, as you already mentioned, the first step would be to have a list of actions on the editor that the users can invoke.
Another alternative https://github.com/basecamp/trix