Remove all inline styling with Paste From Word

Mike Bilz asked on January 19, 2017 20:48

Hello Everyone,

I've noticed that the "Paste from Word" button in the CKEditor does not remove all of the inline styling created by Microsoft Word. Specifically, the margin-left and margin-right attributes remain untouched.

Is there a way for me to configure the CKEditor to remove all inline styling with "Paste from Word"?

I had tried adding config.disallowedContent = 'p[style]{*}'; to the CKEditor's config.js file. But this won't work because Kentico disables the CKEditor ACF by defualt.

I assume I need to alter something in the pastefromword plugin, but I have no idea how to accomplish that.

Any help would be greatly appreciated. Thanks in advance.


Recent Answers

Zach Perry answered on January 19, 2017 22:04 (last edited on January 19, 2017 22:05)

Does config.pasteFromWordRemoveStyles = true; work?

0 votesVote for this answer Mark as a Correct answer

Mike Bilz answered on January 23, 2017 20:30

Hi Zachary,

I've added that code, but it doesn't seem to have any effect. Paragraphs copied from word still retain their margin-left styling. <p style="margin-left:1.0in;">This is a paragraph.</p>

All other styling seems to be removed, but for some reason the margin styling is staying put.

Any help would be appreciated. Thanks.


0 votesVote for this answer Mark as a Correct answer

Russell Vanek answered on August 31, 2017 19:04

Has this been solved? We are currently running Kentico 10 and having this exact same issue.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.