KendoEditor changing HTML Format

1 Answer 11 Views
Editor
Sac
Top achievements
Rank 1
Sac asked on 25 Apr 2025, 06:28 AM

We are using KendoEditor in our MVC application. When assigend HTML to it it is auto formatting it. E.g.
<p style="font-size:13.3333px;"><span style="font-family:Verdana, Geneva, sans-serif;font-size:14pt;">Dear ABC</></></></span></p><p style="font-size:13.3333px;"><span style="font-family:Verdana, Geneva, sans-serif;font-size:14pt;">We have received your details:&nbsp;</span><span style="color:#ffffff;"><span id="spa123"><span> Certificates</span><table class="tbl" border="1" cellpadding="1" cellspacing="0" style="width:100%;font-family:inherit;font-size:inherit;color:inherit;" ><tr style="font-weight:bold;"><td style="text-align: right">Id</td><td style="text-align: left">name</td><td style="text-align: left">Amount</td><td style="text-align: left">Other</td><td style="text-align: left">Comments</td></tr><tr><td style="text-align: right;">1</td><td style="text-align: left;"></td><td style="text-align: left;"></td><td style="text-align: left;"></td><td style="text-align: left;"></td></tr></table></span></span> <span style="background-color:#ffffff;color:#ffffff;"></span></p>

changing to 

<p style="font-size:13.3333px;"><span style="font-family:Verdana, Geneva, sans-serif;font-size:14pt;">Dear ABC</span></p>
<p style="font-size:13.3333px;"><span style="font-family:Verdana, Geneva, sans-serif;font-size:14pt;">We have received your details:&nbsp;</span><span style="color:#ffffff;"><span id="spa123"><span>Certificates</span></span></span></p>
<table class="tbl k-table" border="1" cellpadding="1" cellspacing="0" style="width:100%;font-family:inherit;font-size:inherit;color:inherit;"><tbody><tr style="font-weight:bold;"><td style="text-align:right;">Id</td>
<td style="text-align:left;">name</td>
<td style="text-align:left;">Amount</td>
<td style="text-align:left;">Other</td>
<td style="text-align:left;">Comments</td>
</tr>
<tr><td style="text-align:right;">1</td>
<td style="text-align:left;">&nbsp;</td>
<td style="text-align:left;">&nbsp;</td>
<td style="text-align:left;">&nbsp;</td>
<td style="text-align:left;">&nbsp;</td>
</tr>
</tbody></table>
<span style="background-color:#ffffff;color:#ffffff;"></span><p>&nbsp;</p>

Here <span> and <P> tags automatically getting closed before table. while extected is all should be in span with <span style="color:#ffffff;">.

 

Not able to trace why it is happning.

1 Answer, 1 is accepted

Sort by
0
Anton Mironov
Telerik team
answered on 29 Apr 2025, 07:20 AM

Hi Sac,

Thank you for the details provided.

In order to achieve the desired behavior, I would recommend setting the PasteCleanup configurations of the Editor:

Give a try to the approach above - set the PasteCleanup configurations and observe the resulting behavior.

Kind Regards,
Anton Mironov
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
Sac
Top achievements
Rank 1
Answers by
Anton Mironov
Telerik team
Share this question
or