Remove CSS Class and other properties from Telerik Editor HTML Code

1 Answer 251 Views
Editor
TJ
Top achievements
Rank 1
TJ asked on 25 Mar 2023, 11:19 AM

Hi everyone,

I'm using the Telerik UI for ASP.NET Core Editor to add my content from a Word file, but I'm encountering an issue. When I copy content from the Word file and paste it into the editor, additional CSS classes are being added to the tags.

For example: I copied paragraph from Word File and its looking like this (Class of MsoNormal and other style properties are added)

<p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:medium;">Drivida Marketplace provides a comprehensive guide to school owners with tools to manage their educational institutions effectively.</p>
<p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:medium;">&nbsp;</p>
<p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:medium;">This comprehensive guide aims to provide school owners with a clear understanding of the suite of tools available within the platform, enabling them to manage their educational institution effectively. Here's what you can do with the School Portal:</p>
<p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:medium;">&nbsp;</p>
<p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:medium;">&nbsp;</p>

Is there any way to Remove these Class and other properties from Telerik Editor HTML Code? 

Can anyone help me resolve this issue?

I am also attaching sample Word File

Thank you!

1 Answer, 1 is accepted

Sort by
0
Aleksandar
Telerik team
answered on 29 Mar 2023, 10:34 AM

Hello TJ,

Can you share the Editor configuration? In general, the Editor facilitates the DOM clipboard events. Any content that is pasted is first processed by the browser. After the browser processes the content, the Editor applies the PasteCleanup() options which help control the content that will be pasted. We have a section dedicated on pasting content from Word that describes the options for the PastCleanup configuration.

Are there any PasteCleanup options configured? By default MS specific tags are stripped and if you disable any paste cleanup, for example, the observed behavior will occur, as you can see in this screencast.

Regards,
Aleksandar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Editor
Asked by
TJ
Top achievements
Rank 1
Answers by
Aleksandar
Telerik team
Share this question
or