Completed
Last Updated: 28 Mar 2019 16:44 by ADMIN
Calvin
Created on: 15 Jun 2018 18:57
Category: Editor
Type: Bug Report
1
Strip Span Element After Paste Doesn't Apply
Hello,

There seems to be an issue with the "Strip Span Elements" tool when pasting content into the editor in Design mode.

I have made a screencast demonstrating the issue available here: https://www.screencast.com/t/1OZ1huYPde8H

Reproduce:

Open a RadEditor demo that has the "Strip Span Elements" option like the Overview(https://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx) or the Right Editor in this demo(https://demos.telerik.com/aspnet-ajax/editor/examples/cleaningwordformatting/defaultcs.aspx).

In a word document create text that when pasted into the editor has spans, for example changing the background color or the text color. 

Copy the text from the document into the "Design" mode of the editor.
Select the text you would like to strip span's from (I used all of the text in the screencast example).

Use the "Strip Span Elements" button.

Switch the editor mode to HTML(The spans are not stripped).

Switch back to design mode.

Select the text you would like to remove spans from again.

Use the "Strip Span Elements" button. The spans are now stripped.
 


Expected result: Strip Span Elements option removes <span> tags from html directly after pasting into design mode.

Actual result: Strip Span Elements option does not remove <span> tags on pasted text in the design mode until you navigate to HTML mode then back to design mode.
 
Any help and suggestions are appreciated.

Thanks,

Calvin Williams
1 comment
ADMIN
Rumen
Posted on: 28 Mar 2019 16:44
Hi Calvin,

The "Strip Span Elements" does not work, because the ConvertFontToSpan filter converts all span tags to font tags in Design mode.

If you disable this content filter the "Strip Span Elements" will work as expected. You can see how to do that in the following demo: Built-in Content Filters.

Another option is to strip the font tags with "Strip Font Elements".

Best regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.