Apple-interchange-newline class appearing in RadEditor

2 posts, 1 answers
  1. Cameron
    Cameron avatar
    28 posts
    Member since:
    Oct 2011

    Posted 31 Jan 2012 Link to this post

    Hello,

    While trying to debug an issue with the RadEditor that we're having I ran into this and am not sure why or where it's coming from.
    In Design mode I create a table, for example a 2x2 table with a number in each cell.
    I go into HTML mode and remove the <p><br /></p> tags.

    So all I have in the HTML is the following:
    <table>
        <tbody>
            <tr>
                <td>1&nbsp;</td>
                <td>2&nbsp;</td>
            </tr>
            <tr>
                <td>3&nbsp;</td>
                <td>4&nbsp;</td>
            </tr>
        </tbody>
    </table>

    Now I got back into Design mode, press the Enter key, and copy and paste the existing table.
    The result is the following:
    <table>
        <tbody>
            <tr>
                <td>1&nbsp;</td>
                <td>2&nbsp;</td>
            </tr>
            <tr>
                <td>3&nbsp;</td>
                <td>4&nbsp;</td>
            </tr>
        </tbody>
    </table>
    <div style="padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; background-image: none; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
    <table>
        <tbody>
            <tr>
                <td>1&nbsp;</td>
                <td>2&nbsp;</td>
            </tr>
            <tr>
                <td>3&nbsp;</td>
                <td>4&nbsp;</td>
            </tr>
        </tbody>
    </table>
    </div>
    <br class="Apple-interchange-newline">
    <br>

    Where did that class reference come from and why is it there?
    FYI, we are using version 2011.3.1305.40. I am using the RadEditor on Chrome on a Windows 7.

    Any ideas would be good.

    One side question: what does FixEnclosingP literally do when you disable it? What does it do when you enable it?

    Thanks,
    Cameron
  2. Answer
    Rumen
    Admin
    Rumen avatar
    14366 posts

    Posted 01 Feb 2012 Link to this post

    Hi,

    The <br class="Apple-interchange-newline"> is added by Chrome. You can reproduce the same behavior in an editable IFRAME element as the attached one. Here is a video demonstrating my test: http://screencast.com/t/MbUTSmecj7r. If you would like you can attach to the OnClientPasteHtml event of RadEditor, check for the Paste command and strip this tag.

    I also found that this behavior does not exist in an editable DIV. You can set the content area as an editable DIV by setting ContentAreaMode="Div".

    By default, Internet Explorer wraps the content inside a paragraph tag - this is the default root <p> tag. If this tag is missing the browser automatically adds it. We got many request however to change this behavior, because it was 'tricking" the validators to believe that there is content in the editor. Secondly it was spoiling the layout of page because the content loaded in the editor without the paragraph would be returned surrounded by a paragraph. That's why we decided to change this by implementing the FixEnclosingP content filter which removes this root paragraph in Internet Explorer. If you need this paragraph tag then just disable this filter using the DisableFilter server method of RadEditor or the ContentFilters property, e.g.
    RadEditor1.DisableFilter(EditorFilters.FixEnclosingP);

    Best regards,
    Rumen
    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