RadEditor Strip Span Bug

3 posts, 0 answers
  1. Calvin
    Calvin avatar
    1 posts
    Member since:
    Jun 2018

    Posted 15 Jun 2018 Link to this post

    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 or the Right Editor in this demo.
    • 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

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4944 posts

    Posted 20 Jun 2018 Link to this post

    Hello Calvin,

    I suggest you configure the StripFormattingOptions property so that spans are removed from the content on paste. You can read more about this in the following article: https://docs.telerik.com/devtools/aspnet-ajax/controls/editor/managing-content/pasting-content/clean-ms-word-formatting.

    And here is an example that results in the video attached below (I am also attaching the test document as a reference).

    <telerik:RadEditor RenderMode="Lightweight" runat="server" ID="RadEditor1"
        StripFormattingOptions="ConvertWordLists, MSWordNoMargins, Span">
        <Tools>
            <telerik:EditorToolGroup>
                <telerik:EditorTool Name="FormatStripper" />
            </telerik:EditorToolGroup>
        </Tools>
    </telerik:RadEditor>


    Regards,
    Marin Bratanov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4944 posts

    Posted 25 Jun 2018 Link to this post

    We worked with Calvin in a private thread to get a better overview of the issue and scenario.

    For the majority of cases, I would recommend setting up automatic content stripping. If you have advanced users who understand HTML and the elements, you can track the status of the issue with stripping spans in this scenario in the following page: https://feedback.telerik.com/Project/108/Feedback/Details/251543-after-pasting-from-ms-word-stripspan-does-not-work-until-a-mode-change-to-html-a.


    Regards,
    Marin Bratanov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top