0

We have some basic to complex formatting in our Word docs that conform to a corporate style guide, but am having problems getting that styling to copy over in the "Paste from Word" function. I got headings to convert using Word Styles to format them, but italics, lists, and text colors don't get copied over. Even using other Word Styles don't convert in the copy process.

How do I get these basic Word formatting and styles to copy over to my WYGWAM module? We have writers creating content to a specific style guide and then editors copying that content to the website are then having to manually re-apply those styles.

1

Alas Word places lots of junk into anything it copies out, so you're on to a loser to begin with. It will paste random sizes and spans that don't exist and then you have uncontrollable colours and sizes all over that can no longer be controlled by a single/master CSS file, as they're all in-line.

That said, you can try your best.

Set up custom styles in Wygwam: https://docs.pixelandtonic.com/wygwam/using/style_set.html

Set both the CSS and JS (for the dropdown options). enter image description here

Note the "Restrict allowed HTML" and "extraAllowedContent" options - you may need to play with these, but these may only kick-in when pasting normally, not pasting from Word. Wygwam is based on CKEditor, so you may need to tweak these files to do anything serious like add an additional plug-in - see here for extending Wygwam with CKEditor plugins.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.