+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / RadEditor span tag injection issue

RadEditor span tag injection issue

4 posts, 0 answered
  1. Ivan
    Ivan avatar
    51 posts
    Registered:
    22 Aug 2007
    11 Jun 2010
    Link to this post
    Hi,

    I have been getting an intermittent error when entering html content in the editor.  Here is the scenario:

    1. I will copy and paste html content into a generic content block's html mode
    2. I toggle between design and html mode
    3. Upon returning to html mode, the following tag is injected in certain sections of the markup <span xmlns="http://www.w3.org/1999/xhtml">.

    Here is a sample of what occurs:
    Original pasted as html
    01.<div id="sectionlanding-main-content">
    02.    <div class="descriptive-text meet">
    03.        <h1>xxxxxxxxx.</h1>
    04.        <h2>xxxxxxxxxxxxxxxxxxxx.</h2>
    05.        <h3>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.</h3>
    06.        <p>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</p>
    07.    </div>
    08.    <div id="sectionlanding-sub-content">
    09.        <div id="sectionlanding-meeting-content">
    10.            <span class="module meet no-inner">
    11.                <p class="img">
    12.                    <img alt="" src="/images/stay/furniture.jpg" />
    13.                </p>
    14.                <div class="module-content">
    15.                    <h3>xxxxxxxxxxxxxxxxxx</h3>
    16.                    <p>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.</p>
    17.                    <ul class="paddLeft">
    18.                        <li>Sed elit arcu, convallis </li>
    19.                        <li>non fringilla eu, rhoncus sit </li>
    20.                        <li>amet turpis. Praesent et quam </li>
    21.                    </ul>
    22.                    <p>
    23.                        <a class="call2action">xxxxxxxxxxxxxx</a>
    24.                    </p>
    25.                </div>
    26.            </span>
    27.        </div>
    28.        <div id="sectionlanding-social-content">
    29.            <div class="social">
    30.                <li class="email">
    31.                    <a class=" originalAttribute=">Email</a>
    32.                </li>
    33.                <li class="share">
    34.                    <a class=" originalAttribute=">Share</a>
    35.                </li>
    36.                <li class="print">
    37.                    <a class=" originalAttribute=">Print</a>
    38.                </li>
    39.            </div>
    40.            <div class="action-box">
    41.                <h1>Module Title</h1>
    42.                <p>Duis aute irure dolor in reprehenderit in:</p>
    43.                <p>
    44.                    <input name="module" type="button" value="Book Package" />
    45.                </p>
    46.                <p>For more information about this package, call us:</p>
    47.                <p>1-800-555-1212</p>
    48.            </div>
    49.        </div>
    50.    </div>
    51.</div>

    After toggle to design mode and back
    01.<div id="sectionlanding-main-content">
    02.    <div class="descriptive-text meet">
    03.        <h1>xxxxxxxxx.</h1>
    04.        <h2>xxxxxxxxxxxxxxxxxxxx.</h2>
    05.        <h3>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.</h3>
    06.        <p>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</p>
    07.    </div>
    08.    <div id="sectionlanding-sub-content">
    09.        <div id="sectionlanding-meeting-content">
    10.            <span class="module meet no-inner">
    11.                <p class="img">
    12.                    <span xmlns="http://www.w3.org/1999/xhtml">
    13.                        <img alt="" src="/images/stay/furniture.jpg" />
    14.                    </span>
    15.                </p>
    16.                <span xmlns="http://www.w3.org/1999/xhtml">                     </span>
    17.                <div class="module-content">
    18.                    <span xmlns="http://www.w3.org/1999/xhtml">                         </span>
    19.                    <h3>
    20.                        <span xmlns="http://www.w3.org/1999/xhtml">xxxxxxxxxxxxxxxxxx</span>
    21.                    </h3>
    22.                    <span xmlns="http://www.w3.org/1999/xhtml">                         </span>
    23.                    <p>
    24.                        <span xmlns="http://www.w3.org/1999/xhtml">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.</span>
    25.                    </p>
    26.                    <span xmlns="http://www.w3.org/1999/xhtml">                         </span>
    27.                    <ul class="paddLeft">
    28.                        <span xmlns="http://www.w3.org/1999/xhtml">
    29.                            <li>Sed elit arcu, convallis </li>
    30.                            <li>non fringilla eu, rhoncus sit </li>
    31.                            <li>amet turpis. Praesent et quam </li>
    32.                        </span>
    33.                    </ul>
    34.                    <span xmlns="http://www.w3.org/1999/xhtml">                         </span>
    35.                    <p>
    36.                        <span xmlns="http://www.w3.org/1999/xhtml">
    37.                            <a class="call2action">xxxxxxxxxxxxxx</a>
    38.                        </span>
    39.                    </p>
    40.                    <span xmlns="http://www.w3.org/1999/xhtml">                     </span>
    41.                </div>
    42.                <span xmlns="http://www.w3.org/1999/xhtml">                 </span>
    43.            </span>
    44.        </div>
    45.        <div id="sectionlanding-social-content">
    46.            <div class="social">
    47.                <li class="email">
    48.                    <a class=" originalAttribute=">Email</a>
    49.                </li>
    50.                <li class="share">
    51.                    <a class=" originalAttribute=">Share</a>
    52.                </li>
    53.                <li class="print">
    54.                    <a class=" originalAttribute=">Print</a>
    55.                </li>
    56.            </div>
    57.            <div class="action-box">
    58.                <h1>Module Title</h1>
    59.                <p>Duis aute irure dolor in reprehenderit in:</p>
    60.                <p>
    61.                    <input type="button" value="Book Package" name="module" />
    62.                </p>
    63.                <p>For more information about this package, call us:</p>
    64.                <p>1-800-555-1212</p>
    65.            </div>
    66.        </div>
    67.    </div>
    68.</div>


    Does anyone know what causes this behavior or more importantly how to stop this behavior?  It is breaking the page layout in the stylesheet.

    We are using Sitefinity 3.7 SP3.

    This is affecting our push for a production launch.  Thanks in advance.
    -Ivan
  2. Ivan
    Ivan avatar
    51 posts
    Registered:
    22 Aug 2007
    11 Jun 2010
    Link to this post
    A little further investigation into this shows that this is happening in Firefox when pasting html content with newline characters.  It seems the newlines are being converted to the spans.

    Is there a way to prevent this conversion?

    I have tried looking for the ~/Sitefinity/Admin/ControlTemplates/Generic_Content/EditorTemplate.ascx to modify so the radeditor options but can't find it.  It is also not in the 3.5 external templates?  Can this template be provided?

    Thanks.
    -Ivan
  3. MB
    MB avatar
    302 posts
    Registered:
    09 Jan 2005
    12 Jun 2010
    Link to this post
    Just as an aside... the standards say that SPAN is intended for INLINE content (such as text) while DIV is intended for BLOCK content... therefore, your original HTML actually violates the standards use of SPAN, by using it to wrap BLOCK content. I would suggest you consider using a DIV element instead.
  4. Ivan
    Ivan avatar
    51 posts
    Registered:
    22 Aug 2007
    14 Jun 2010
    Link to this post
    Thanks MB.  I will make this adjustment.
Register for webinar
4 posts, 0 answered