Completed
Last Updated: 13 Aug 2021 11:49 by ADMIN
Release Q1 2015
ADMIN
Rumen
Created on: 15 Apr 2011 06:43
Category: Editor
Type: Bug Report
1
StripFormattingOptions="AllExceptNewLines" does not work as expected
When paragraphs are pasted from e.g., MS Word, multiple BR tags are pasted instead of the corresponding amount needed.

The flowing custom handler shows how this can be handled as per to the specific requirements:

<telerik:RadEditor runat="server" ID="RadEditor1"
    OnClientPasteHtml="OnClientPasteHtml"
    StripFormattingOptions="AllExceptNewLines">
</telerik:RadEditor>

<script type="text/javascript">
    function OnClientPasteHtml(editor, args) {
        var commandName = args.get_commandName();
        var contentToPaste = args.get_value();

        if (commandName === "Paste") {
            contentToPaste = contentToPaste.replace(/(<br\/>)+/gi, "<br/>");

            args.set_value(contentToPaste);
        }
    }
</script>
0 comments