Text is changed after saving to the back-end

4 posts, 0 answers
  1. Geoffrey
    Geoffrey avatar
    1 posts
    Member since:
    Nov 2010

    Posted 19 Jul 2012 Link to this post

    I am experiencing issues with line breaks being added/removed, text being moved around, and font sizes/weight/type changing after saving using the radeditor.  Even on the demo site, if I paste in the content, switch the editor from enabled to disabled, I see line breaks being added. I am using paragraphs, not breaks. What is going on here and is there a setting I can add to stop this from occuring?

    More Info: I am using version 2012.1.411.35. Browser is IE8.

    I have attached before and after saving images.


  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 23 Jul 2012 Link to this post

    Hello Geoffrey,

    Regarding the font-size/weight issue - this behavior may occur in case where the browser's default font settings differs from the decorations applied to the container where the editor's content will be displayed. Detailed information regarding this behavior and a workaround are available in the following KB article:
    No FONT tags are applied when I type text in the editor

    Regarding the issue with the extra breaks and content positioning - I tried to reproduce it locally but to no avail. Could you please provide sample content reproducing the issue so we can examine and debug it locally?

    The following video demonstrates my test trying to replicate the content from the provided screenshots, could you please see if I am missing something?
    http://screencast.com/t/qz8yYHXa2B

    Also, here is the content generated by the editor using its InsertTable Tool:
    <p>Sample text</p>
    <table>
        <tbody>
            <tr>
                <td> </td>
                <td> test</td>
                <td> test</td>
                <td> test</td>
                <td> test</td>
            </tr>
            <tr>
                <td> test</td>
                <td> > 11%</td>
                <td> 11-11%</td>
                <td> < 11% </td>
                <td> 11%</td>
            </tr>
            <tr>
                <td> test</td>
                <td> < 11%</td>
                <td> 11-11</td>
                <td> > 11pts</td>
                <td> 11pts</td>
            </tr>
        </tbody>
    </table>
    <p>This is test sentence.</p>
    <p>Examples:</p>
    <table style="width: 277px; height: 99px;">
        <tbody>
            <tr>
                <td style="width: 200px;"> test</td>
                <td> 11</td>
            </tr>
            <tr>
                <td> test</td>
                <td> 11</td>
            </tr>
            <tr>
                <td> <span style="text-decoration: underline;">test</span></td>
                <td> 11</td>
            </tr>
            <tr>
                <td> test</td>
                <td> 11</td>
            </tr>
        </tbody>
    </table>

    As you can see, no text decoration is applied to the table cells and that is why the font-size differs when the editor is enabled / disabled.

    Kind regards,
    Dobromir
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Philip
    Philip avatar
    5 posts
    Member since:
    Apr 2011

    Posted 23 Jul 2012 Link to this post

    Hello,

    Thank you for your response.  I have attached screenshots of a simpler example which you should be able to reproduce. 

    In your editor, switch the newlinemode to paragraph. 

    Enter one line of text and press enter.  Insert a table and press enter.  It appears that an extra paragraph is being added before the table.  Please see attched screen shots.  Thank you.
  4. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 27 Jul 2012 Link to this post

    Hi Philip,

    Thank you for the provided additional information. I was able to reproduce the problem and I can confirm that this is a bug in RadEditor. I have logged this issue in our database and we will do our best to have it fixed for one of the upcoming release.

    For the time being, I can suggest you the following workaround:
    <telerik:RadEditor ID="RadEditor1" runat="server" NewLineMode="P" OnClientCommandExecuting="editorCommandExecuting">
    </telerik:RadEditor>
     
     
    <script type="text/javascript">
        function editorCommandExecuting(editor, args)
        {
            if(args.get_commandName() == "InsertTable" || args.get_commandName() == "TableWizard")
            {
                var selElem = editor.getSelectedElement();
                if(selElem && selElem.tagName.toLowerCase() == "p" && selElem.innerHTML.replace(/\u0160/gi,"").replace(/\s*/,"") == "")
                    selElem.parentNode.removeChild(selElem);
            }
        }
    </script>


    All the best,
    Dobromir
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top