Stephane Grenier
Stephane Grenier

Reputation: 15925

How do I add html styles in Vaadin's RichTextEditor like was possible in Vaadin 8 RichTextArea

For example in Vaadin 8 with the RichTextArea I could add <style> in the html and that would be respected. As well I could add table (yes old school but still valid html) however in RichTextEditor any <style> is completely removed and the tables are changed to <p> tags. I'm trying to transition an app from Vaadin 8 and this it is critically important to be able to edit text through html directly within the application as a lot of the existing data is in html. Any assistance would be greatly appreciated.

Upvotes: 0

Views: 176

Answers (1)

Rolf
Rolf

Reputation: 2418

The new RichTextEditor introduced in Vaadin 10 is based on the Quill library, which does not yet support tables (https://github.com/quilljs/quill/issues/117).

The examples in the documentation give a pretty good picture of what formatting is supported.

Styles can be applied inline to each element, and by applying a stylesheet to the RTE component using a theme or @CssImport

There are also add-ons based on other libraries that might be a better fit, e.g. https://vaadin.com/directory/component/ckeditorvaadin and https://vaadin.com/directory/component/tinymceeditorforvaadin, but I haven't checked their table or styling support.

Upvotes: 2

Related Questions