Blazorise icon indicating copy to clipboard operation
Blazorise copied to clipboard

Richtext: Replace QuillJs

Open WolfgangKluge opened this issue 2 years ago • 11 comments

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)

WolfgangKluge avatar Jun 15 '22 23:06 WolfgangKluge

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.

stsrki avatar Jun 16 '22 07:06 stsrki

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

BartjeD avatar Dec 30 '22 14:12 BartjeD

It's not very good-looking, but I like how it has so many features—going on the list.

stsrki avatar Dec 30 '22 18:12 stsrki

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.

njannink avatar Mar 22 '23 17:03 njannink

The best would be to start a new extension Blazorise.RichTextEdit.Rooster and deprecate the old RichTextEdit sometime in the future.

njannink avatar Mar 22 '23 17:03 njannink

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.

stsrki avatar Mar 22 '23 17:03 stsrki

for a v2 I would stop supporting Quill completely. I believe it has security leaks

njannink avatar Mar 22 '23 17:03 njannink

Well, as long as be abstract good enough, users can choose the editor they want without breaking anything.

stsrki avatar Mar 22 '23 17:03 stsrki

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 avatar Mar 28 '23 15:03 njannink

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

stsrki avatar Mar 28 '23 18:03 stsrki

Another alternative https://github.com/basecamp/trix

stsrki avatar Apr 02 '24 14:04 stsrki