Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Pasting contents of a word document to RichTextArea
I want to copy and paste contents of a word document to a Vaadin RichTextArea. I'm using Jsoup to sanitize these textareas to protect the web service against cross-site scripting attacks. It is working fine.
I don't need any fancy Word formatting where the value of the RichTextArea is used, so is there any way to remove the indentation of text? It is okay for all the paragraphs to just start from the beginning of the row in each line. No need for Headings and paragraph leading and such whitespaces to be present. So, in short: how to remove indentation from the pasted word document content? Also, it would be bonus to remove all word formatting from the text, if possible.
EDIT: One possible solution would be somehow disabling the MS Word formatting when pasting the content onto the RichTextArea. Would that be possible in any way?
EDIT2: According to my research (feverous googling), it seems that TinyMCE is my best bet. I'm currently trying TinyMCE wrapper for Vaadin 7 ( https://vaadin.com/directory#!addon/tinymce-wrapper ) I'll post later how it went.
Implementing TinyMCE solved all the formatting problems sufficiently, since it is easy for the user to adjust the formatting in the TinyMCETextField, which wasn't possible in Vaadin RichTextArea, since the Word-formatting is more compatible with TinyMCE.
Now if I only would know how to change the too small default font-size in the editor...:)