Days
Hours
Minutes
Seconds
x

New Froala Editor v5.0.0 is here โ€“ Learn More

Skip to content
Froala Documentation

Word Paste Plugin

Plugins are fully functional during your trial once you've added your trial key to the setup.

Users paste a lot from Word and Excel. Froala WYSIWYG HTML Editor cleans all the unnecessary code and makes the HTML just look good.


Plugin options:

wordAllowedStyleProps
Array -
The list of allowed CSS attributes to be used for tags when pasting from Word.
Default:
['font-family', 'font-size', 'background', 'color', 'width', 'text-align', 'vertical-align', 'background-color', 'padding', 'margin', 'height', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'text-decoration', 'font-weight', 'font-style', 'text-indent', 'border', 'border-.*']
wordDeniedAttrs
Array -
Attributes that are removed when pasting something into the rich text editor from Word.
Default:[]
wordDeniedTags
Array -
Tags that are removed together with their content when pasting something into the rich text editor from Word.
Default:[]
wordPasteModal
Boolean -
Show modal to choose if to keep or not styles pasted from Word. If set to false, the default action is to keep the formatting.
Default: true
wordPasteKeepFormatting
Boolean -
Choose the default action when wordPasteModal option is enabled.
Default: true

Plugin events:

paste.after ()
Triggered after pasting something into the Froala Rich Text Editor.
paste.afterCleanup (clipboard_html)
Triggered after the content was pasted from the clipboard into the Froala Rich Text Editor and it was cleaned up. If a string is returned, the new string will be used as the pasted content.
โ— clipboard_html
A string with the pasted content after it was cleaned up.
paste.before (original_event)
Triggered before pasting something into the Froala Rich Text Editor.
Note: Returning false in the handler assigned to the event will cancel the current action.
โ— original_event
The jQuery event object for the paste event.
paste.beforeCleanup (clipboard_html)
Triggered after the content is pasted from the clipboard into the Froala Rich Text Editor. If a string is returned the new string will be used as the pasted content.
โ— clipboard_html
The clipboard pasted HTML.
paste.wordPaste (clipboard_html)
Triggered after the content is pasted from the MS Office into the Froala Rich Text Editor.
โ— clipboard_html
The clipboard pasted HTML.

Add Plugin to your code:

Plugin name: wordPaste

Plugin JS Script: ../js/plugins/word_paste.min.js

Or from CDN https://cdn.jsdelivr.net/npm/froala-editor@latest/js/plugins/word_paste.min.js

Plugin CSS link:

Ready to dive in? Explore our plans

Sign up

Download the code by signing up for our newsletter

Sign up

Download the code by signing up for our newsletter

Note: By registering, you confirm that you agree to the processing of your personal data by Froala, Inc. - Froala as described in the Privacy Statement. Froala, Inc. - Froala is part of the Idera group and may share your information with its parent company Idera, Inc., and its affiliates. For further details on how your data is used, stored, and shared, please review our Privacy Statement.